C# Class hobd.SensorRegistry

Registry with active set of sensors
Datei anzeigen Open project: cail/hobd Class Usage Examples

Public Methods

Method Description
Add ( Sensor sensor ) : void
AddAlias ( Sensor sensor, string alias ) : void
AddListener ( Sensor sensor, Action listener ) : void
AddListener ( Sensor sensor, Action listener, int period ) : void

Adds listener for the specified sensor

Use period of milliseconds to update the reading. Default is 0 - means update as fast as possible

AddListener ( string sensor, Action listener ) : void
AddListener ( string sensor, Action listener, int period ) : void
AddPassiveListener ( Action listener ) : void

Passive listeners are the listeners who listen for all currently active sensors

CreateObject ( string clazz ) : object
Deactivate ( ) : void
DumpState ( ) : void
EnumerateSensors ( ) : IEnumerable

Returns enumeration of all the available registered sensors

RegisterObjectCreator ( object>.Func creator ) : void
RegisterProvider ( SensorProvider provider ) : void
RegisterProvider ( string provider ) : void

Provider should be either a SensorProvider full class name, or special string

Remove ( Sensor sensor ) : void
RemoveListener ( Action listener ) : void

Detaches the specifed listener for all sensors

RemoveListener ( Sensor sensor, Action listener ) : void

Removes the listener for the specified sensor

RemoveListener ( string sensor, Action listener ) : void

alias for RemoveListener

RemovePassiveListener ( Action listener ) : void
Sensor ( string id ) : Sensor

Gets the sensor with the specified ID or alias

Sensor ( string id, Sensor notthis ) : Sensor
SensorRegistry ( ) : System
TriggerListeners ( Sensor sensor ) : void
TriggerReset ( ) : void

Triggers sensor reset event for all sensors that supports it

TriggerSuspend ( ) : void

Triggers sensor suspend event for all sensors that supports it

Private Methods

Method Description
ListenerHandler ( ) : void

Method Details

Add() public method

public Add ( Sensor sensor ) : void
sensor Sensor
return void

AddAlias() public method

public AddAlias ( Sensor sensor, string alias ) : void
sensor Sensor
alias string
return void

AddListener() public method

public AddListener ( Sensor sensor, Action listener ) : void
sensor Sensor
listener Action
return void

AddListener() public method

Adds listener for the specified sensor
Use period of milliseconds to update the reading. Default is 0 - means update as fast as possible
public AddListener ( Sensor sensor, Action listener, int period ) : void
sensor Sensor
listener Action
period int
return void

AddListener() public method

public AddListener ( string sensor, Action listener ) : void
sensor string
listener Action
return void

AddListener() public method

public AddListener ( string sensor, Action listener, int period ) : void
sensor string
listener Action
period int
return void

AddPassiveListener() public method

Passive listeners are the listeners who listen for all currently active sensors
public AddPassiveListener ( Action listener ) : void
listener Action /// A ///
return void

CreateObject() public method

public CreateObject ( string clazz ) : object
clazz string
return object

Deactivate() public method

public Deactivate ( ) : void
return void

DumpState() public method

public DumpState ( ) : void
return void

EnumerateSensors() public method

Returns enumeration of all the available registered sensors
public EnumerateSensors ( ) : IEnumerable
return IEnumerable

RegisterObjectCreator() public method

public RegisterObjectCreator ( object>.Func creator ) : void
creator object>.Func
return void

RegisterProvider() public method

public RegisterProvider ( SensorProvider provider ) : void
provider SensorProvider
return void

RegisterProvider() public method

Provider should be either a SensorProvider full class name, or special string
public RegisterProvider ( string provider ) : void
provider string
return void

Remove() public method

public Remove ( Sensor sensor ) : void
sensor Sensor
return void

RemoveListener() public method

Detaches the specifed listener for all sensors
public RemoveListener ( Action listener ) : void
listener Action /// A ///
return void

RemoveListener() public method

Removes the listener for the specified sensor
public RemoveListener ( Sensor sensor, Action listener ) : void
sensor Sensor
listener Action
return void

RemoveListener() public method

alias for RemoveListener
public RemoveListener ( string sensor, Action listener ) : void
sensor string
listener Action
return void

RemovePassiveListener() public method

public RemovePassiveListener ( Action listener ) : void
listener Action
return void

Sensor() public method

Gets the sensor with the specified ID or alias
public Sensor ( string id ) : Sensor
id string
return Sensor

Sensor() public method

public Sensor ( string id, Sensor notthis ) : Sensor
id string
notthis Sensor
return Sensor

SensorRegistry() public method

public SensorRegistry ( ) : System
return System

TriggerListeners() public method

public TriggerListeners ( Sensor sensor ) : void
sensor Sensor
return void

TriggerReset() public method

Triggers sensor reset event for all sensors that supports it
public TriggerReset ( ) : void
return void

TriggerSuspend() public method

Triggers sensor suspend event for all sensors that supports it
public TriggerSuspend ( ) : void
return void