C# Class Mycroft.App.Registry

Stores AppInstances
Not thread safe; only the Dispatcher's main processing thread should touch this class
Inheritance: ICommandable
Show file Open project: rit-sse-mycroft/core Class Usage Examples

Public Methods

Method Description
GetAllRelated ( Capability capability ) : IEnumerable

Returns all instances that depend on or provide a capability

GetDependents ( Capability capability ) : IEnumerable

Gets instances that depend on a capability

GetProviders ( Capability capability ) : IEnumerable

Gets instances that provide a capability

HasInstance ( string instanceId ) : bool

Checks if an app with a specific instance ID exists

Issue ( Command command ) : void
Register ( AppInstance instance ) : bool

Adds an instance to the registry

Remove ( AppInstance instance ) : bool

Removes an app from the registry, used when an instance disconnects

TryGetInstance ( string instanceId, AppInstance &outInstance ) : bool

Retrives an app instance with that ID

Method Details

GetAllRelated() public method

Returns all instances that depend on or provide a capability
public GetAllRelated ( Capability capability ) : IEnumerable
capability Capability
return IEnumerable

GetDependents() public method

Gets instances that depend on a capability
public GetDependents ( Capability capability ) : IEnumerable
capability Capability
return IEnumerable

GetProviders() public method

Gets instances that provide a capability
public GetProviders ( Capability capability ) : IEnumerable
capability Capability
return IEnumerable

HasInstance() public method

Checks if an app with a specific instance ID exists
public HasInstance ( string instanceId ) : bool
instanceId string
return bool

Issue() public method

public Issue ( Command command ) : void
command Mycroft.Cmd.Command
return void

Register() public method

Adds an instance to the registry
public Register ( AppInstance instance ) : bool
instance AppInstance
return bool

Remove() public method

Removes an app from the registry, used when an instance disconnects
public Remove ( AppInstance instance ) : bool
instance AppInstance
return bool

TryGetInstance() public method

Retrives an app instance with that ID
public TryGetInstance ( string instanceId, AppInstance &outInstance ) : bool
instanceId string
outInstance AppInstance
return bool