Go to the documentation of this file.
65 #ifndef DEVICE_FACTORY_H
66 #define DEVICE_FACTORY_H
XsDevice *(* MasterConstructFunc)(DeviceFactory &deviceFactory, Communicator *comm)
A function prototype that provides the device factory and communicator.
XsDevice *(* StandaloneConstructFunc)(Communicator *comm)
A function prototype that provides the communicator.
virtual void removeExistingDevice(XsDeviceId const &deviceId)
Tell our device manager to remove any devices matching deviceId.
unsigned int DeviceTypeId
Provides the device type ID as unsigned int.
virtual DeviceTypeId deviceToTypeId(XsDeviceId const &deviceId) const
converts an XsDeviceId to an DeviceTypeId
bool registerStandaloneDeviceType(DeviceTypeId deviceTypeId, StandaloneConstructFunc constructFunc)
Registers a standalone device type. After registration, the factory is able to cerate an instance of ...
A base struct for a communication interface.
virtual XsDevice * createMasterDevice(Communicator *communicator, bool doInitialize=true)
Creates and initializes a master device with a specified communicator. The type of the new device is ...
static const DeviceFactory::DeviceTypeId INVALID
virtual XsDevice * constructDevice(DeviceTypeId deviceTypeId, Communicator *comm)
Constructs a master device of a specified deviceTypeId with a specified communicator....
Contains an Xsens device ID and provides operations for determining the type of device.
std::map< DeviceTypeId, StandaloneConstructFunc > m_standaloneConstructors
std::map< DeviceTypeId, MasterConstructFunc > m_masterConstructors
DeviceFactory()
Default constructor.
bool registerMasterDeviceType(DeviceTypeId deviceTypeId, MasterConstructFunc constructFunc)
Registers a master device type. After registration, the factory is able to cerate an instance of the ...
virtual void registerDevices()
register all known device types
bool initializeDevice(XsDevice &device) const
Initializes a device (if not already initialized)
A Factory for the devices.