RTI Connext Modern C++ API  Version 6.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::xtypes::LoanedDynamicData Class Reference

<<move-only-type>> Gives temporary access to a member of another DynamicData object. More...

#include <DynamicDataImpl.hpp>

Public Member Functions

 ~LoanedDynamicData ()
 Returns the loan if it has not been returned with return_loan()
 
void return_loan ()
 Explicitly returns the loan.
 
DynamicData & get ()
 Obtains the loaned DynamicData object representing a member of DynamicData object.
 
const DynamicData & get () const
 Obtains the loaned DynamicData object representing a member of DynamicData object.
 
 operator DynamicData & ()
 Conversion to DynamicData for convenience.
 
 operator const DynamicData & () const
 Conversion to DynamicData for convenience.
 
LoanedDynamicDataoperator= (LoanedDynamicData &&other) OMG_NOEXCEPT
 <<C++11>> Allows reusing a LoanedDynamicData instance.
 

Detailed Description

<<move-only-type>> Gives temporary access to a member of another DynamicData object.

This type can only be instantiated through dds::core::xtypes::DynamicData::loan_value. This type can't be copied. It can be moved <<C++11>>.

An instance of this type contains a direct reference to a member of another DynamicData object, retrieved with get(). That object can be both inspected or modified and has to be eventually returned.

There are three ways to return the loan:

  1. Letting the destructor do it
  2. Calling return_loan()
  3. Reusing this object to obtain another loan (see dds::core::xtypes::DynamicData::loan_value(LoanedDynamicData&,uint32_t))
See Also
dds::core::xtypes::DynamicData::loan_value
Using DynamicData

Constructor & Destructor Documentation

rti::core::xtypes::LoanedDynamicData::~LoanedDynamicData ( )

Returns the loan if it has not been returned with return_loan()

Member Function Documentation

void rti::core::xtypes::LoanedDynamicData::return_loan ( )

Explicitly returns the loan.

DynamicData& rti::core::xtypes::LoanedDynamicData::get ( )
inline

Obtains the loaned DynamicData object representing a member of DynamicData object.

The object can be modified and the changes will take effect in the DynamicData object that contains this one.

const DynamicData& rti::core::xtypes::LoanedDynamicData::get ( ) const
inline

Obtains the loaned DynamicData object representing a member of DynamicData object.

rti::core::xtypes::LoanedDynamicData::operator DynamicData & ( )
inline

Conversion to DynamicData for convenience.

rti::core::xtypes::LoanedDynamicData::operator const DynamicData & ( ) const
inline

Conversion to DynamicData for convenience.

LoanedDynamicData& rti::core::xtypes::LoanedDynamicData::operator= ( LoanedDynamicData &&  other)
inline

<<C++11>> Allows reusing a LoanedDynamicData instance.

Since copying a LoanedDynamicData is disabled, only the move-assignment operator is allowed.

This operation returns the loan that *this currently holds.

For example:

LoanedDynamicData member = sample.loan_value(1);
member = sample.loan_value(2);
See Also
dds::core::xtypes::DynamicData::loan_value(LoanedDynamicData&, const std::string&)

RTI Connext Modern C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc