32 #include <boost/shared_ptr.hpp>
33 #include <boost/noncopyable.hpp>
73 :
private boost::noncopyable
77 typedef boost::shared_ptr<CDevice>
Pointer;
83 std::string
GetID()
const;
86 bool HasType(std::string type)
const;
89 bool HasState(std::string signal)
const;
121 #endif // C_DEVICE_HPP
SignalValue GetState(std::string signal) const
Gets the current state of some signal from the adapter.
Definition: CDevice.cpp:183
bool HasType(std::string type) const
Checks if the device recognizes a type.
Definition: CDevice.cpp:131
Defines the interface used to access physical hardware.
Definition: CDevice.hpp:72
Stores the internal structure of a device object.
Definition: CDevice.hpp:40
std::set< std::string > s_type
Set of types a device recognizes.
Definition: CDevice.hpp:43
std::set< std::string > s_command
Set of command signals a device recognizes.
Definition: CDevice.hpp:49
bool HasCommand(std::string signal) const
Checks if the device recognizes a command signal.
Definition: CDevice.cpp:163
std::set< std::string > s_state
Set of state signals a device recognizes.
Definition: CDevice.hpp:46
IAdapter::Pointer m_adapter
Adapter that handles the storage for this device.
Definition: CDevice.hpp:114
void SetCommand(std::string signal, SignalValue value)
Sets the next command for some signal in the adapter.
Definition: CDevice.cpp:241
DeviceInfo m_devinfo
Internal structure of this device.
Definition: CDevice.hpp:111
float SignalValue
Type of the value for device signals.
Definition: IAdapter.hpp:42
std::set< std::string > GetCommandSet() const
Gets the set of command signals recognized by the device.
Definition: CDevice.cpp:221
CDevice(std::string id, DeviceInfo info, IAdapter::Pointer adapter)
Constructs a device with a specific structure and adapter.
Definition: CDevice.cpp:96
boost::shared_ptr< CDevice > Pointer
Pointer to physical device interface.
Definition: CDevice.hpp:77
std::string m_devid
Unique identifier for this device.
Definition: CDevice.hpp:108
bool HasState(std::string signal) const
Checks if the device recognizes a state signal.
Definition: CDevice.cpp:147
boost::shared_ptr< IAdapter > Pointer
Pointer to a physical adapter.
Definition: IAdapter.hpp:72
std::string GetID() const
Gets the unique identifier for this device.
Definition: CDevice.cpp:115
std::set< std::string > GetStateSet() const
Gets the set of state signals recognized by the device.
Definition: CDevice.cpp:206
std::ostream & operator<<(std::ostream &os, const DeviceInfo &info)
Outputs the device information to the passed output stream.
Definition: CDevice.cpp:62