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
Factory(const Factory &factory)=delete
Disabled copy constructor.
Callback< Device *, const std::string &, const Device::DeviceType & > InstanceFunction
Definition of a callback function creating a specific device.
Definition devices/Factory.h:37
AdhocFactory()
Creates a new factory object.
friend class Manager
Definition devices/Manager.h:53
Lock lock_
The Manager's lock.
Definition devices/Manager.h:209
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.
std::vector< std::unique_ptr< Factory > > FactoryUniquePointers
Definition of a vector holding unique pointers of factories.
Definition devices/Manager.h:66
std::unordered_multimap< Measurement::ObjectId, std::string > ObjectIdMultimap
Definition of an unsorted multimap mapping object ids to descriptions.
Definition devices/Manager.h:71
friend class Factory
Definition devices/Manager.h:34
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.
Factory::InstanceFunction AdhocInstanceFunction
Definition of a callback function creating an ad-hoc device.
Definition devices/Manager.h:42
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.
Factory * factory(const std::string &name, TemporaryScopedLock &scopedLock)
Returns a specified factory.
FactoryUniquePointers factories_
All registered device factories.
Definition devices/Manager.h:206
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)
Registers an ad-hoc device at this manager.
Strings devices() const
Returns a list with the names of all available devices.
friend class Measurement
Definition devices/Manager.h:35
virtual ~Manager()
Destructs a manager object.
void release()
Destructs all registered libraries and their corresponding factories.
ObjectIdMultimap objectIdMultimap_
The map mapping object ids to descriptions.
Definition devices/Manager.h:200
bool registerFactory(std::unique_ptr< Factory > &&factory)
Registers a new factory.
static std::string nameAdhocFactory()
Returns the name of the ad-hoc factory.
Measurement::ObjectId uniqueObjectIdCounter_
The counter for unique object ids.
Definition devices/Manager.h:203
Strings devices(const Device::DeviceType type) const
Returns a list with the names of all available devices matching a major and minor device type.
uint32_t ObjectId
Definition of an object id.
Definition Measurement.h:47
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a recursive scoped lock object allowing to release the lock before the scoped o...
Definition Lock.h:266
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
ObjectRef< Device > DeviceRef
This class implements a device reference with an internal reference counter.
Definition DeviceRef.h:27
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15