8 #ifndef META_OCEAN_DEVICES_MANAGER_H
9 #define META_OCEAN_DEVICES_MANAGER_H
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
This class implements a factory able to create instances of devices.
Definition: devices/Factory.h:28
Callback< Device *, const std::string &, const Device::DeviceType & > InstanceFunction
Definition of a callback function creating a specific device.
Definition: devices/Factory.h:37
This class implements an ad-hoc factory for devices which are implemented outside of an own library e...
Definition: devices/Manager.h:52
AdhocFactory()
Creates a new factory object.
This class implements as singleton-based manager which allows to access all available devices.
Definition: devices/Manager.h:32
Lock lock_
The Manager's lock.
Definition: devices/Manager.h:201
bool unregisterFactory(const std::string &factory)
Unregisters a factory.
bool unregisterAdhocDevice(const std::string &deviceName)
Unregisters a previously registered ad-hoc device from this manager.
DeviceRef device(const std::string &name, const bool useExclusive=false)
Returns a specific device.
Strings libraries() const
Returns the names of all registered libraries.
std::string objectDescription(const Measurement::ObjectId objectId) const
Returns the description of an object id.
bool isRegistered(const std::string &library)
Returns whether a specified library is registered at this manager.
DeviceRef device(const Device::DeviceType type, const bool useExclusive=false)
Returns a specified device.
Manager()
Creates a new manager object.
FactoryUniquePointers factories_
All registered device factories.
Definition: devices/Manager.h:198
std::unordered_multimap< Measurement::ObjectId, std::string > ObjectIdMultimap
Definition of an unsorted multimap mapping object ids to descriptions.
Definition: devices/Manager.h:71
Measurement::ObjectId createUniqueObjectId(const std::string &description)
Creates a unique object id for a new object (e.g., a tracking object like an image,...
bool registerAdhocDevice(const std::string &deviceName, const Device::DeviceType &deviceType, const AdhocInstanceFunction &deviceInstanceFunction)
Registes an ad-hoc device at this manager.
Strings devices() const
Returns a list with the names of all available devices.
virtual ~Manager()
Destructs a manager object.
std::vector< std::unique_ptr< Factory > > FactoryUniquePointers
Definition of a vector holding unique pointers of factories.
Definition: devices/Manager.h:66
void release()
Destructs all registered libraries and their corresponding factories.
ObjectIdMultimap objectIdMultimap_
The map mapping object ids to descriptions.
Definition: devices/Manager.h:192
bool registerFactory(std::unique_ptr< Factory > &&factory)
Registers a new factory.
static std::string nameAdhocFactory()
Returns the name of the ad-hoc factory.
Strings devices(const Device::DeviceType type) const
Returns a list with the names of all available devices matching a major and minor device type.
This class implements the base class for all devices providing measurement samples.
Definition: Measurement.h:40
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
This class implements a recursive lock object.
Definition: Lock.h:31
This template class is the base class for all singleton objects.
Definition: Singleton.h:71
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition: Base.h:162
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15