Ocean
Ocean::Devices::SmartDeviceRef< T > Class Template Reference

This class implements a smart device reference. More...

Inheritance diagram for Ocean::Devices::SmartDeviceRef< T >:

Public Member Functions

 SmartDeviceRef ()
 Creates an empty smart device reference. More...
 
 SmartDeviceRef (const DeviceRef &deviceRef)
 Creates a new smart device reference by a given device reference. More...
 
 SmartDeviceRef (Device *object)
 Creates a new SmartDeviceRef by a given object. More...
 
template<typename T2 >
 SmartDeviceRef (const SmartDeviceRef< T2 > &reference)
 Copies a smart device reference. More...
 
SmartDeviceRefoperator= (const DeviceRef &deviceRef)
 Assigns a smart device reference. More...
 
- Public Member Functions inherited from Ocean::SmartObjectRef< T, Device >
 SmartObjectRef ()=default
 Creates a new SmartObjectRef with no internal object. More...
 
 SmartObjectRef (T *object)
 Creates a new SmartObjectRef by a given object. More...
 
 SmartObjectRef (T *object, const ReleaseCallback &releaseCallback)
 Creates a new SmartObjectRef by a given object. More...
 
 SmartObjectRef (const SmartObjectRef< T, Device > &smartObjectRef)
 Copy constructor. More...
 
 SmartObjectRef (SmartObjectRef< T, Device > &&smartObjectRef)
 Move constructor. More...
 
 SmartObjectRef (const ObjectRef< Device > &objectRef)
 Creates a new SmartObjectRef by a given ObjectRef. More...
 
 SmartObjectRef (const SmartObjectRef< T2, Device > &smartObjectRef)
 Copies a SmartObjectRef object. More...
 
SmartObjectRef< T, Device > & operator= (const SmartObjectRef< T, Device > &smartObjectRef)
 Assign operator. More...
 
SmartObjectRef< T, Device > & operator= (SmartObjectRef< T, Device > &&smartObjectRef)
 Moves a smart object reference object to this smart object reference. More...
 
SmartObjectRef< T, Device > & operator= (const ObjectRef< Device > &objectRef)
 Assigns a ObjectRef to this smart object reference. More...
 
void release ()
 Releases the internal object, if any. More...
 
T * pointer () const
 Returns a pointer to the objects that is encapsulated by this wrapper. More...
 
T * operator-> () const
 Returns a point to the internal object if existing. More...
 
T & operator* () const
 Returns a reference to the internal object if existing. More...
 
- Public Member Functions inherited from Ocean::ObjectRef< Device >
 ObjectRef ()=default
 Creates an empty ObjectRef object. More...
 
 ObjectRef (const ObjectRef< Device > &objectRef)
 Copy constructor. More...
 
 ObjectRef (ObjectRef< Device > &&object) noexcept
 Move constructor. More...
 
 ObjectRef (Device *object)
 Creates a new ObjectRef holding a given object. More...
 
 ObjectRef (Device *object, const ReleaseCallback &releaseCallback)
 Creates a new ObjectRef holding and managing a given object. More...
 
 ~ObjectRef ()
 Destructs an object reference object and releases the internal object if possible. More...
 
T2 & force () const
 Returns a reference to the internal object forcing to a specified type. More...
 
Device * operator-> () const
 Returns a point to the internal object if existing. More...
 
Device & operator* () const
 Returns a reference to the internal object if existing. More...
 
bool isUnique () const
 Returns whether there is no other object reference but this one. More...
 
bool isNull () const
 Returns whether this object reference holds no internal object. More...
 
void release ()
 Releases the internal object, if any. More...
 
Device * pointer () const
 Returns a pointer to the objects that is encapsulated by this wrapper. More...
 
ObjectRef< Device > & operator= (const ObjectRef< Device > &objectRef)
 Assign operator. More...
 
ObjectRef< Device > & operator= (ObjectRef< Device > &&right) noexcept
 Move operator. More...
 
bool operator== (const ObjectRef< Device > &objectRef) const
 Returns whether two object references are holds the same internal object. More...
 
bool operator!= (const ObjectRef< Device > &objectRef) const
 Returns whether two object references are not equal. More...
 
bool operator< (const ObjectRef< Device > &objectRef) const
 Returns whether the left object is less than the right one. More...
 
 operator bool () const
 Returns whether this object reference holds an internal object. More...
 

Private Types

typedef SmartObjectRef< T, Device >::ReleaseCallback ReleaseCallback
 Redefinition of the release callback function defined in ObjectRef. More...
 

Additional Inherited Members

- Public Types inherited from Ocean::SmartObjectRef< T, Device >
typedef ObjectRef< Device >::ReleaseCallback ReleaseCallback
 Redefinition of the release callback function defined in ObjectRef. More...
 
- Public Types inherited from Ocean::ObjectRef< Device >
typedef Callback< void, const Device * > ReleaseCallback
 Definition of a release callback function. More...
 
- Static Protected Member Functions inherited from Ocean::ObjectRef< Device >
static void destroyObject (Device *object)
 Destroys the object located in the ObjectHolder object. More...
 
- Protected Attributes inherited from Ocean::SmartObjectRef< T, Device >
T * objectPointer_
 Pointer to the internal object. More...
 
- Protected Attributes inherited from Ocean::ObjectRef< Device >
ObjectHolder * objectHolder_
 Pointer to the object holder. More...
 

Detailed Description

template<typename T>
class Ocean::Devices::SmartDeviceRef< T >

This class implements a smart device reference.

Template Parameters
TType of the derived object that has to be encapsulated by the smart reference object

Member Typedef Documentation

◆ ReleaseCallback

template<typename T >
typedef SmartObjectRef<T, Device>::ReleaseCallback Ocean::Devices::SmartDeviceRef< T >::ReleaseCallback
private

Redefinition of the release callback function defined in ObjectRef.

Constructor & Destructor Documentation

◆ SmartDeviceRef() [1/4]

template<typename T >
Ocean::Devices::SmartDeviceRef< T >::SmartDeviceRef

Creates an empty smart device reference.

◆ SmartDeviceRef() [2/4]

template<typename T >
Ocean::Devices::SmartDeviceRef< T >::SmartDeviceRef ( const DeviceRef deviceRef)

Creates a new smart device reference by a given device reference.

Parameters
deviceRefDevice reference to copy

◆ SmartDeviceRef() [3/4]

template<typename T >
Ocean::Devices::SmartDeviceRef< T >::SmartDeviceRef ( Device object)
explicit

Creates a new SmartDeviceRef by a given object.

This given object will be released by the smart device reference itself.

Parameters
objectInternal object

◆ SmartDeviceRef() [4/4]

template<typename T >
template<typename T2 >
Ocean::Devices::SmartDeviceRef< T >::SmartDeviceRef ( const SmartDeviceRef< T2 > &  reference)

Copies a smart device reference.

Parameters
referenceReference to copy

Member Function Documentation

◆ operator=()

template<typename T >
SmartDeviceRef< T > & Ocean::Devices::SmartDeviceRef< T >::operator= ( const DeviceRef deviceRef)

Assigns a smart device reference.

Parameters
deviceRefreference Reference to assign
Returns
Reference to this object

The documentation for this class was generated from the following file: