nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
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>

Collaboration diagram for NDS::abi_0::data_stream_iterator:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< buffers_typevalue_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.
 
DLL_EXPORT data_stream_iterator (const data_stream_iterator &other)
 Copy constructor.
 
DLL_EXPORT data_stream_iterator (data_stream_iterator &&other) noexcept
 Move constructor.
 
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.
 
DLL_EXPORT data_stream_iteratoroperator= (data_stream_iterator &&other) noexcept
 Move operator.
 
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.
 
DLL_EXPORT data_stream_iteratoroperator++ ()
 
DLL_EXPORT data_stream_iterator operator++ (int)
 

Private Attributes

std::shared_ptr< detail::iterate_handlerp_
 
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

◆ difference_type

◆ iterator_category

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

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ data_stream_iterator() [1/4]

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

Default constructor.

The iterator is defined in an empty/end state.

◆ data_stream_iterator() [2/4]

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.

◆ data_stream_iterator() [3/4]

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.

◆ data_stream_iterator() [4/4]

NDS::abi_0::data_stream_iterator::data_stream_iterator ( std::shared_ptr< detail::iterate_handler p,
value_type  c 
)

◆ ~data_stream_iterator()

NDS::abi_0::data_stream_iterator::~data_stream_iterator ( )
default

Member Function Documentation

◆ operator!=()

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

◆ operator*()

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.

◆ operator++() [1/2]

data_stream_iterator & NDS::abi_0::data_stream_iterator::operator++ ( )
Note
This updates the state of the associated data_iterable object.

◆ operator++() [2/2]

data_stream_iterator NDS::abi_0::data_stream_iterator::operator++ ( int  )
Note
This updates the state of the associated data_iterable object.

◆ operator=() [1/2]

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.

◆ operator=() [2/2]

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.

◆ operator==()

bool NDS::abi_0::data_stream_iterator::operator== ( const data_stream_iterator other) const

Member Data Documentation

◆ cache_

value_type NDS::abi_0::data_stream_iterator::cache_
private

◆ p_

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: