|
virtual | ~IAdapter () |
| Virtual destructor for derived classes. More...
|
|
std::set< std::string > | GetDevices () const |
| Get the list of registered device names. More...
|
|
virtual SignalValue | GetState (const std::string device, const std::string signal) const =0 |
| Retrieves a value from a device. More...
|
|
void | RegisterDevice (const std::string devid) |
| Register a device name with the adapter. More...
|
|
virtual void | SetCommand (const std::string device, const std::string signal, const SignalValue value)=0 |
| Sets a value on a device. More...
|
|
virtual void | Start ()=0 |
| Starts the adapter. More...
|
|
virtual void | Stop ()=0 |
| Stops the adapter. Guaranteed to be thread-safe. More...
|
|
Defines the interface each device uses to perform its operations. The concrete adapter is responsible for implementation of both Get and Set functions.
The adapter class is intended to be private to the device subsystem. If you want to access it from outside devices, you are doing something wrong.
- Limitations:
- Adapters must be shut down via IAdapter::Stop() exactly once before they are destructed in order to ensure correct behavior. An adapter that has been shut down while references to it still exist is basically an empty shell: IAdapter::Get() is guaranteed to return the same value that it did before the adapter was stopped, and IAdapter::Set() is guaranteed to silently fail.