RTI Connext Modern C++ API  Version 5.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::sub::SharedSamples Class Reference

<<reference-type>> A sharable and container-safe version of LoanedSamples. More...

#include <dds/sub/SharedSamples.hpp>

Public Member Functions

 SharedSamples (dds::sub::LoanedSamples< T > &ls)
 Constructs and instance of SharedSamples removing the ownership of the loan from the LoanedSamples.
 
const_iterator begin () const
 Same as LoanedSamples::begin()
 
const_iterator end () const
 Same as LoanedSamples::end()
 
DELEGATE< T >::value_type operator[] (size_t index) const
 Same as LoanedSamples::operator[](size_t)
 
uint32_t length () const
 Returns the number of samples.
 

Detailed Description

<<reference-type>> A sharable and container-safe version of LoanedSamples.

A SharedSamples instance is constructed from a LoanedSamples instance, removing the ownership of the loan from the LoanedSamples.

The destruction of the LoanedSamples object or the explicit invocation of its method return_loan will have no effect on loaned data.

Constructing a SharedSamples from another SharedSamples, creates a new reference to the same loan. Loaned data will be returned automatically to the DataReader once the reference count reaches zero.

See Also
LoanedSamples

Constructor & Destructor Documentation

dds::sub::SharedSamples::SharedSamples ( dds::sub::LoanedSamples< T > &  ls)
inline

Constructs and instance of SharedSamples removing the ownership of the loan from the LoanedSamples.

The constructor is implicit to simplify statements like the following:

SharedSamples samples = reader.take(); // reader.take() returns LoanedSamples
Parameters
lsthe loaned samples.

Member Function Documentation

const_iterator dds::sub::SharedSamples::begin ( ) const
inline
const_iterator dds::sub::SharedSamples::end ( ) const
inline
DELEGATE<T>::value_type dds::sub::SharedSamples::operator[] ( size_t  index) const
inline
uint32_t dds::sub::SharedSamples::length ( ) const
inline

Returns the number of samples.

See Also
LoanedSamples::length()

RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc