Ocean
Ocean::Media::SmartMediumRef< T > Class Template Reference

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

Inheritance diagram for Ocean::Media::SmartMediumRef< T >:

Public Member Functions

 SmartMediumRef ()
 Creates an empty smart medium reference. More...
 
 SmartMediumRef (const MediumRef &mediumRef)
 Creates a new smart medium reference by a given medium reference. More...
 
 SmartMediumRef (Medium *object)
 Creates a new SmartMediumRef by a given object. More...
 
template<typename T2 >
 SmartMediumRef (const SmartMediumRef< T2 > &reference)
 Copies a smart medium reference. More...
 
SmartMediumRefoperator= (const MediumRef &mediumRef)
 Assigns a smart medium reference. More...
 
- Public Member Functions inherited from Ocean::SmartObjectRef< T, Medium >
 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, Medium > &smartObjectRef)
 Copy constructor. More...
 
 SmartObjectRef (SmartObjectRef< T, Medium > &&smartObjectRef)
 Move constructor. More...
 
 SmartObjectRef (const ObjectRef< Medium > &objectRef)
 Creates a new SmartObjectRef by a given ObjectRef. More...
 
 SmartObjectRef (const SmartObjectRef< T2, Medium > &smartObjectRef)
 Copies a SmartObjectRef object. More...
 
SmartObjectRef< T, Medium > & operator= (const SmartObjectRef< T, Medium > &smartObjectRef)
 Assign operator. More...
 
SmartObjectRef< T, Medium > & operator= (SmartObjectRef< T, Medium > &&smartObjectRef)
 Moves a smart object reference object to this smart object reference. More...
 
SmartObjectRef< T, Medium > & operator= (const ObjectRef< Medium > &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< T >
 ObjectRef ()=default
 Creates an empty ObjectRef object. More...
 
 ObjectRef (const ObjectRef< T > &objectRef)
 Copy constructor. More...
 
 ObjectRef (ObjectRef< T > &&object) noexcept
 Move constructor. More...
 
 ObjectRef (T *object)
 Creates a new ObjectRef holding a given object. More...
 
 ObjectRef (T *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...
 
template<typename T2 >
T2 & force () const
 Returns a reference to the internal object forcing to a specified type. 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...
 
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...
 
T * pointer () const
 Returns a pointer to the objects that is encapsulated by this wrapper. More...
 
ObjectRef< T > & operator= (const ObjectRef< T > &objectRef)
 Assign operator. More...
 
ObjectRef< T > & operator= (ObjectRef< T > &&right) noexcept
 Move operator. More...
 
bool operator== (const ObjectRef< T > &objectRef) const
 Returns whether two object references are holds the same internal object. More...
 
bool operator!= (const ObjectRef< T > &objectRef) const
 Returns whether two object references are not equal. More...
 
bool operator< (const ObjectRef< T > &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, Medium >::ReleaseCallback ReleaseCallback
 Redefinition of the release callback function defined in ObjectRef. More...
 

Additional Inherited Members

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

Detailed Description

template<typename T>
class Ocean::Media::SmartMediumRef< T >

This class implements a smart medium 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, Medium>::ReleaseCallback Ocean::Media::SmartMediumRef< T >::ReleaseCallback
private

Redefinition of the release callback function defined in ObjectRef.

Constructor & Destructor Documentation

◆ SmartMediumRef() [1/4]

template<typename T >
Ocean::Media::SmartMediumRef< T >::SmartMediumRef

Creates an empty smart medium reference.

◆ SmartMediumRef() [2/4]

template<typename T >
Ocean::Media::SmartMediumRef< T >::SmartMediumRef ( const MediumRef mediumRef)

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

Parameters
mediumRefMedium reference to copy

◆ SmartMediumRef() [3/4]

template<typename T >
Ocean::Media::SmartMediumRef< T >::SmartMediumRef ( Medium object)
explicit

Creates a new SmartMediumRef by a given object.

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

Parameters
objectInternal object

◆ SmartMediumRef() [4/4]

template<typename T >
template<typename T2 >
Ocean::Media::SmartMediumRef< T >::SmartMediumRef ( const SmartMediumRef< T2 > &  reference)

Copies a smart medium reference.

Parameters
referenceReference to copy

Member Function Documentation

◆ operator=()

template<typename T >
SmartMediumRef< T > & Ocean::Media::SmartMediumRef< T >::operator= ( const MediumRef mediumRef)

Assigns a smart medium reference.

Parameters
mediumRefreference Reference to assign
Returns
Reference to this object

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