32 #include <boost/asio/io_service.hpp>
33 #include <boost/shared_ptr.hpp>
34 #include <boost/noncopyable.hpp>
35 #include <boost/thread.hpp>
48 typedef std::pair<const std::string, const std::string>
DeviceSignal;
68 :
private boost::noncopyable
72 typedef boost::shared_ptr<IAdapter>
Pointer;
75 virtual void Start() = 0;
78 virtual void Stop() = 0;
82 const std::string signal)
const = 0;
85 virtual void SetCommand(
const std::string device,
const std::string signal,
113 #endif // I_ADAPTER_HPP
Physical adapter device interface.
Definition: IAdapter.hpp:67
std::pair< const std::string, const std::string > DeviceSignal
Type of the unique identifier for device values.
Definition: IAdapter.hpp:48
IAdapter()
Constructor.
Definition: IAdapter.cpp:47
virtual void Stop()=0
Stops the adapter. Guaranteed to be thread-safe.
std::set< std::string > m_devices
Set of registered device names.
Definition: IAdapter.hpp:106
const SignalValue NULL_COMMAND
Sent by the DGI to indicate it knows nothing about the state of a device.
Definition: IAdapter.hpp:45
virtual SignalValue GetState(const std::string device, const std::string signal) const =0
Retrieves a value from a device.
virtual void Start()=0
Starts the adapter.
virtual void SetCommand(const std::string device, const std::string signal, const SignalValue value)=0
Sets a value on a device.
float SignalValue
Type of the value for device signals.
Definition: IAdapter.hpp:42
virtual ~IAdapter()
Virtual destructor for derived classes.
Definition: IAdapter.cpp:60
boost::shared_ptr< IAdapter > Pointer
Pointer to a physical adapter.
Definition: IAdapter.hpp:72
void RevealDevices()
Reveals devices in the device manager.
Definition: IAdapter.cpp:103
void RegisterDevice(const std::string devid)
Register a device name with the adapter.
Definition: IAdapter.cpp:74
std::set< std::string > GetDevices() const
Get the list of registered device names.
Definition: IAdapter.cpp:89