8 #ifndef META_OCEAN_DEVICES_REF_H
9 #define META_OCEAN_DEVICES_REF_H
106 typedef std::multimap<std::string, DevicePair>
DeviceMap;
142 inline bool isEmpty()
const;
149 bool isEmpty(
const std::string& library)
const;
169 inline void removeDeviceCallbackFunction(
const DeviceCallback& callback);
202 template <
typename T>
209 template <
typename T>
216 template <
typename T>
223 template <
typename T>
224 template <
typename T2>
231 template <
typename T>
247 ocean_assert(callback);
This class implements a container for callback functions.
Definition: Callback.h:3456
void removeCallback(const T &callback)
Removes a callback object.
Definition: Callback.h:4050
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
This class is the base class for all devices of any type.
Definition: devices/Device.h:28
This class implements a manager for device references.
Definition: DeviceRef.h:83
bool isEmpty() const
Returns whether no device is registered currently.
Definition: DeviceRef.h:238
Callback< void, Device *, bool > DeviceCallback
Definition of a callback function for devices.
Definition: DeviceRef.h:94
DeviceCallbacks deviceCallbacks_
The callback functions for device events.
Definition: DeviceRef.h:196
std::vector< std::string > devicesFromLibrary(const std::string &library) const
Returns the name of all existing devices which belong to a specific library.
void addDeviceCallbackFunction(const DeviceCallback &callback)
Adds a callback function which is called whenever a new device is created or deleted.
void removeDeviceCallbackFunction(const DeviceCallback &callback)
Removes a previously added callback function for device events.
Definition: DeviceRef.h:245
bool isExclusive(const Device *device)
Returns whether a specified device is registered as exclusive.
bool isEmpty(const std::string &library) const
Returns whether no device is registered created by a specific library.
DeviceRef registerDevice(Device *device, const bool exclusive)
Registers a new device.
virtual ~DeviceRefManager()
Destructs the manager.
Callbacks< DeviceCallback > DeviceCallbacks
Definition of device callback functions.
Definition: DeviceRef.h:111
std::pair< DeviceRef, bool > DevicePair
Definition of a pair combining a device reference with a state specifying whether the medium is used ...
Definition: DeviceRef.h:101
Lock lock_
Lock for the device map.
Definition: DeviceRef.h:199
DeviceRef device(const Device::DeviceType type) const
Returns a specified device by it's device type.
std::multimap< std::string, DevicePair > DeviceMap
Map mapping urls to device references.
Definition: DeviceRef.h:106
void unregisterDevice(const Device *device)
Unregisters a device.
DeviceRef device(const std::string &name) const
Returns a device by a given device name.
DeviceMap deviceMap_
Map holding all device references.
Definition: DeviceRef.h:193
This class implements as singleton-based manager which allows to access all available devices.
Definition: devices/Manager.h:32
This class implements a smart device reference.
Definition: DeviceRef.h:36
SmartDeviceRef(Device *object)
Creates a new SmartDeviceRef by a given object.
Definition: DeviceRef.h:217
SmartDeviceRef & operator=(const DeviceRef &deviceRef)
Assigns a smart device reference.
Definition: DeviceRef.h:232
SmartDeviceRef(const DeviceRef &deviceRef)
Creates a new smart device reference by a given device reference.
Definition: DeviceRef.h:210
SmartObjectRef< T, Device >::ReleaseCallback ReleaseCallback
Redefinition of the release callback function defined in ObjectRef.
Definition: DeviceRef.h:42
SmartDeviceRef()
Creates an empty smart device reference.
Definition: DeviceRef.h:203
SmartDeviceRef(const SmartDeviceRef< T2 > &reference)
Copies a smart device reference.
Definition: DeviceRef.h:225
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This template class is the base class for all singleton objects.
Definition: Singleton.h:71
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition: SmartObjectRef.h:90
SmartObjectRef< T, TBase > & operator=(const SmartObjectRef< T, TBase > &smartObjectRef)
Assign operator.
Definition: SmartObjectRef.h:280
ObjectRef< Device > DeviceRef
This class implements a device reference with an internal reference counter.
Definition: DeviceRef.h:27
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15