DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
dds::core::WeakReference< T > Class Template Reference

#include <WeakReference.hpp>

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 37 of file WeakReference.hpp.

Member Typedef Documentation

template<typename T >
typedef T dds::core::WeakReference< T >::ReferenceType

Definition at line 39 of file WeakReference.hpp.

Constructor & Destructor Documentation

template<typename T >
dds::core::WeakReference< T >::WeakReference ( const T &  t)

Creates a weak reference for the reference type passed as argument

template<typename T >
dds::core::WeakReference< T >::~WeakReference ( )

Member Function Documentation

template<typename T >
bool dds::core::WeakReference< T >::expired ( )

Checks whether the underlying reference has been collected.

Returns
true if the underlying reference has expired, false otherwise
template<typename T >
T dds::core::WeakReference< T >::lock ( )

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


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