Public Types | Public Member Functions

WeakReference< T > Class Template Reference

#include <WeakReference.hpp>

List of all members.

Public Types

typedef T ReferenceType

Public Member Functions

 WeakReference (const T &t)
 ~WeakReference ()
bool expired ()
lock ()

Detailed Description

template<typename T>
class dds::core::WeakReference< T >

The WeakReference class allow to maintain a weak reference to a DDS reference type. Meaning that the existence of a weak link will not prevent the garbage collection of the reference type.

Definition at line 34 of file WeakReference.hpp.


Member Typedef Documentation

typedef T ReferenceType

Definition at line 36 of file WeakReference.hpp.


Constructor & Destructor Documentation

WeakReference ( const T &  t  )  [inline]

Creates a weak reference for the reference type passed as argument

Definition at line 43 of file WeakReference.hpp.

~WeakReference (  )  [inline]

Definition at line 45 of file WeakReference.hpp.


Member Function Documentation

bool expired (  )  [inline]

Checks whether the underlying reference has been collected.

Returns:
true if the underlying reference has expired, false otherwise

Definition at line 52 of file WeakReference.hpp.

T lock (  )  [inline]

Gives access to the underlying reference. If the reference has expired the returned object will be referencing to null

Definition at line 60 of file WeakReference.hpp.


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