RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::core::WeakReference< T > Class Template Reference

#include <WeakReference.hpp>

Public Member Functions

 WeakReference (const T &t)
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.

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

Member Function Documentation

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

Checks whether the underlying reference has been collected.

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

RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc