CoreDX Data Distribution Service
The High Performance, Small Footprint DDS from Twin Oaks Computing, Inc
|
Holds a collection of sample data and related meta-data. More...
Public Types | |
typedef SampleIterator< T, false > | iterator |
typedef SampleIterator< T, true > | const_iterator |
typedef dds_type_traits< T >::SampleIteratorValueType | value_type |
typedef dds_type_traits< T >::ConstSampleIteratorValueType | const_value_type |
typedef std::ptrdiff_t | difference_type |
Public Member Functions | |
LoanedSamples () | |
Default constructor. | |
~LoanedSamples () throw () | |
Destructor. | |
void | release (DataReader &reader_ptr, Seq &data_seq, DDS::SampleInfoSeq &info_seq) |
Transfers the loan to the caller. More... | |
LoanedSamples (LoanMemento loan_memento) throw () | |
Construct from a memento. Provides for efficient copy construction. | |
LoanedSamples & | operator= (LoanMemento loan_memento) throw () |
Assignment operator that preserves loan ownership semantics. | |
Seq & | data_seq () |
Access the contained data sequence. | |
DDS::SampleInfoSeq & | info_seq () |
Access the contained sample info sequence. | |
const Seq & | data_seq () const |
Access the contained data sequence as const. | |
const DDS::SampleInfoSeq & | info_seq () const |
Access the contained sample info sequence as const. | |
value_type | operator[] (size_t index) |
Access a specific element of the contained data sequence. The returned value will be of type SampleRef<T>. | |
const_value_type | operator[] (size_t index) const |
Access a specific element of the contained data sequence as const The returned value will be of type SampleRef<const T>. | |
int | length () const |
Access the length of the contained data sequence. | |
int | size () const |
Access the length of the contained data sequence. | |
void | return_loan () |
Return the loaned data to the originating DataReader. More... | |
void | swap (LoanedSamples &that) throw () |
Swap contents and responsibility between this and 'that'. | |
SharedSamples< T > | to_shared () throw () |
Convert the LoanedSample sequences into a SharedSamples object. More... | |
iterator | begin () |
Obtain a SampleIterator object that refers to the beginning of the data sequence. | |
iterator | end () |
Obtain a SampleIterator object that refers to the end of the data sequence. | |
const_iterator | begin () const |
Obtain a const SampleIterator object that refers to the beginning of the data sequence. | |
const_iterator | end () const |
Obtain a const SampleIterator object that refers to the end of the data sequence. | |
Static Public Member Functions | |
static LoanedSamples< T > | move_construct_from_loans (DataReader reader, Seq &data_seq, DDS::SampleInfoSeq &info_seq) |
Construct from loaned sample and sample info sequences. More... | |
Friends | |
LoanedSamples | move (LoanedSamples &) throw () |
move operator | |
Holds a collection of sample data and related meta-data.
The LoanedSamples object holds the loaned data and meta-data returned from a DataReader::read() operation. The object manages the 'loan' by automatically calling return_loan() on the source DataReader when the object is destroyed.
typedef SampleIterator<T, true> DDS::LoanedSamples< T >::const_iterator |
const_iterator typedef
typedef dds_type_traits<T>::ConstSampleIteratorValueType DDS::LoanedSamples< T >::const_value_type |
const_value_type typedef. Is SampleRef<const T>
typedef std::ptrdiff_t DDS::LoanedSamples< T >::difference_type |
difference_type typedef
typedef SampleIterator<T, false> DDS::LoanedSamples< T >::iterator |
iterator typedef
typedef dds_type_traits<T>::SampleIteratorValueType DDS::LoanedSamples< T >::value_type |
value_type typedef. Is SampleRef<T>
|
static |
Construct from loaned sample and sample info sequences.
Takes over responbility of the loan. Will return when destroyed or explicitly via 'return_loan()', or by transfering the responsibility via 'release()'.
void DDS::LoanedSamples< T >::release | ( | DataReader & | reader_ptr, |
Seq & | data_seq, | ||
DDS::SampleInfoSeq & | info_seq | ||
) |
Transfers the loan to the caller.
The LoanedSamples instance will no longer manage the loaned data. The caller is responsible for ensuring DataReader::return_loan() is invoked as required.
void DDS::LoanedSamples< T >::return_loan | ( | ) |
Return the loaned data to the originating DataReader.
After this call, the LoanedSamples object no longer manages the data or sample info sequences.
SharedSamples<T> DDS::LoanedSamples< T >::to_shared | ( | ) | ||
throw | ( | |||
) |
Convert the LoanedSample sequences into a SharedSamples object.
The SharedSamples object holds a reference to the data and sample info sequences.