nds2-client - ClientUser  0.16.8
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
NDS::abi_0::data_iterable Class Reference

The data_iterable manages streaming data from an NDS::connection. More...

#include <nds_data_iterator.hh>

Public Types

typedef data_stream_iterator iterator_type
 NDS::data_stream_iterator is the iterator type for this object.
 

Public Member Functions

DLL_EXPORT data_iterable (const data_iterable &other)
 Copy constructor. More...
 
DLL_EXPORT data_iterable (data_iterable &&other) noexcept
 Move constructor. More...
 
DLL_EXPORT data_iterableoperator= (const data_iterable &other)
 Copy assignment operator. More...
 
DLL_EXPORT data_iterableoperator= (data_iterable &&other) noexcept
 Move assigment operator. More...
 
DLL_EXPORT iterator_type begin ()
 Return the current start tof the iteration. More...
 
DLL_EXPORT iterator_type end ()
 Return a end/sentinal iterator. More...
 
DLL_EXPORT void abort ()
 Abort an on-going iteration and close the underlying connection. More...
 

Detailed Description

The data_iterable manages streaming data from an NDS::connection.

This class manages a single stream of data by providing a set of input iterators which represent the data stream.

Note
All data from a iteration must be consumed before the underlying connection is available for additional commands.
Due to the demands of iterators, and to keep the number of times buffers are copied, the iteration is done in terms of std::shared_ptr<NDS::buffers_type>. As such the current value is tracked by the data_iterable object and by the iterators. It is important to complete the iteration, and allow the iterators to go out of scope (or be assigned to the end() value) to allow the internal buffers to be released.
The iteration is done when begin() == end().

Constructor & Destructor Documentation

NDS::abi_0::data_iterable::data_iterable ( const data_iterable other)
default

Copy constructor.

A data_iterable may safely be copied. Copied objects refer to the same iteration and share state.

Parameters
otherA data_iterable to copy from.
NDS::abi_0::data_iterable::data_iterable ( data_iterable &&  other)
defaultnoexcept

Move constructor.

A data_iterable may safely be moved.

Parameters
otherA data_iterable to move from.
Note
after a move other is defined as refering to a completed iteration.

Member Function Documentation

void NDS::abi_0::data_iterable::abort ( )

Abort an on-going iteration and close the underlying connection.

Note
As this closes the underlying connection, a new connection object must be used to do any further work after aborting an iteration.
data_iterable::iterator_type NDS::abi_0::data_iterable::begin ( )

Return the current start tof the iteration.

Returns
An iterator_type object referencing the current state of the iteration.
Note
When an iterator is advanced, it updates the shared state of the iteration, and has the side effect of moving where begin references.
the returned iterator satisfies the requirements of an InputIterator
data_iterable::iterator_type NDS::abi_0::data_iterable::end ( )

Return a end/sentinal iterator.

Returns
An iterator_type object referencing the end state of the iteration.
Note
the returned iterator satisfies the requirements of an InputIterator
data_iterable & NDS::abi_0::data_iterable::operator= ( const data_iterable other)
default

Copy assignment operator.

A data_iterable may safely be copied. Copied objects refer to the same iteration and share state.

Parameters
otherThe data_iterable to copy from
Returns
A reference to *this
data_iterable & NDS::abi_0::data_iterable::operator= ( data_iterable &&  other)
defaultnoexcept

Move assigment operator.

A data_iterable may safely be moved.

Parameters
otherA data_iterable to move from.
Note
after a move other is defined as refering to a completed iteration.

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