nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
NDS::abi_0::data_stream_iterator Class Reference

A input iterator. More...

#include <nds_data_iterator.hh>

Public Types

typedef std::shared_ptr
< buffers_type
value_type
 
typedef value_typereference
 
typedef value_typepointer
 
typedef std::size_t difference_type
 
typedef std::input_iterator_tag iterator_category
 

Public Member Functions

DLL_EXPORT data_stream_iterator ()
 Default constructor. More...
 
DLL_EXPORT data_stream_iterator (const data_stream_iterator &other)
 Copy constructor. More...
 
DLL_EXPORT data_stream_iterator (data_stream_iterator &&other) noexcept
 Move constructor. More...
 
DLL_EXPORT data_stream_iterator (std::shared_ptr< detail::iterate_handler > p, value_type c)
 
DLL_EXPORT ~data_stream_iterator ()
 
DLL_EXPORT data_stream_iteratoroperator= (const data_stream_iterator &other)
 Copy operator. More...
 
DLL_EXPORT data_stream_iteratoroperator= (data_stream_iterator &&other) noexcept
 Move operator. More...
 
DLL_EXPORT bool operator== (const data_stream_iterator &other) const
 
DLL_EXPORT bool operator!= (const data_stream_iterator &other) const
 
DLL_EXPORT reference operator* ()
 Access the data at the current location of the iteration. More...
 
DLL_EXPORT data_stream_iteratoroperator++ ()
 
DLL_EXPORT data_stream_iterator operator++ (int)
 

Private Attributes

std::shared_ptr
< detail::iterate_handler
p_
 
value_type cache_
 

Detailed Description

A input iterator.

This is the iterator type used by NDS::data_iterable.

Note
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 sentinal/empty value) to allow the internal buffers to be released.

Member Typedef Documentation

typedef std::input_iterator_tag NDS::abi_0::data_stream_iterator::iterator_category

Constructor & Destructor Documentation

NDS::abi_0::data_stream_iterator::data_stream_iterator ( )

Default constructor.

The iterator is defined in an empty/end state.

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

Copy constructor.

A data_stream_iterator can be safely copied. When done the two iterators will refer to the same iteration and reference the same data.

Parameters
otherThe iterator to copy from.
NDS::abi_0::data_stream_iterator::data_stream_iterator ( data_stream_iterator &&  other)
defaultnoexcept

Move constructor.

A data_stream_iterator can be safely moved. When done other will be in an empty/end state.

Parameters
otherThe iterator to move from.
NDS::abi_0::data_stream_iterator::data_stream_iterator ( std::shared_ptr< detail::iterate_handler p,
value_type  c 
)
NDS::abi_0::data_stream_iterator::~data_stream_iterator ( )
default

Member Function Documentation

bool NDS::abi_0::data_stream_iterator::operator!= ( const data_stream_iterator other) const
data_stream_iterator::reference NDS::abi_0::data_stream_iterator::operator* ( )

Access the data at the current location of the iteration.

Returns
A reference to the current data.
Note
While the iterator is not in an end/empty state and the iteration is not complete this will never return a null shared_ptr.
data_stream_iterator & NDS::abi_0::data_stream_iterator::operator++ ( )
Note
This updates the state of the associated data_iterable object.
data_stream_iterator NDS::abi_0::data_stream_iterator::operator++ ( int  )
Note
This updates the state of the associated data_iterable object.
data_stream_iterator & NDS::abi_0::data_stream_iterator::operator= ( const data_stream_iterator other)
default

Copy operator.

A data_stream_iterator can be safely copied. When done the two iterators will refer to the same iteration and reference the same data.

Parameters
otherThe iterator to copy from.
data_stream_iterator & NDS::abi_0::data_stream_iterator::operator= ( data_stream_iterator &&  other)
defaultnoexcept

Move operator.

A data_stream_iterator can be safely moved. When done other will be in an empty/end state.

Parameters
otherThe iterator to move from.
bool NDS::abi_0::data_stream_iterator::operator== ( const data_stream_iterator other) const

Member Data Documentation

value_type NDS::abi_0::data_stream_iterator::cache_
private
std::shared_ptr< detail::iterate_handler > NDS::abi_0::data_stream_iterator::p_
private

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