matador::const_container_iterator< Type, ContainerType > Class Template Reference

Represents a const has many iterator. More...

#include <container_iterator.hpp>

Public Types

typedef const_container_iterator< Type, ContainerType > self
 
typedef traits::value_type value_type
 
typedef traits::holder_type holder_type
 
typedef traits::difference_type difference_type
 
typedef traits::holder_container_iterator holder_container_iterator
 
typedef traits::holder_const_container_iterator const_holder_container_iterator
 

Public Member Functions

 const_container_iterator ()=default
 Creates an empty const has many iterator.
 
 const_container_iterator (holder_container_iterator iter)
 Creates a const has many iterator from given internal container iterator.
 
 const_container_iterator (const_holder_container_iterator iter)
 Creates a const has many iterator from given internal const container iterator.
 
 const_container_iterator (const container_iterator< Type, ContainerType > &iter)
 Creates a const has many iterator from a has many iterator.
 
 const_container_iterator (const self &iter)
 Copy construct a const_has_many_iterator from given iterator.
 
const_container_iteratoroperator= (const self &iter)
 Copy assigns a new const has many iterator.
 
const_container_iteratoroperator= (const container_iterator< Type, ContainerType > &iter)
 Copy assigns a new const has many iterator.
 
bool operator== (const self &i) const
 Compares equality iterator with another iterator.
 
bool operator!= (const self &i) const
 Compares unequality iterator with another iterator.
 
bool operator< (const self &i) const
 Compares less than iterator with another iterator.
 
selfoperator++ ()
 Pre increments self.
 
self operator++ (int)
 Post increments iterator.
 
selfoperator-- ()
 Pre decrements self.
 
self operator-- (int)
 Post decrements iterator.
 
selfoperator+= (difference_type offset)
 Increments iterator with offset.
 
selfoperator-= (difference_type offset)
 Decrements iterator with offset.
 
self operator+ (difference_type offset) const
 Increments iterator with offset.
 
self operator- (difference_type offset) const
 Decrements iterator with offset.
 
const value_type operator-> () const
 
const value_typeoperator* () const
 

Friends

class container< Type, ContainerType >
 
class basic_container< Type, ContainerType >
 
class object_serializer
 
class detail::object_inserter
 
difference_type operator- (self a, self b)
 Returns the difference of two iterators a and b.
 
const self operator+ (difference_type offset, self out)
 

Detailed Description

template<class Type, template< class ... > class ContainerType>
class matador::const_container_iterator< Type, ContainerType >

Represents a const has many iterator.

Represents a const has many iterator for a has many relationship with std::vector container

Template Parameters
TThe type of the iterator/container

Member Typedef Documentation

◆ const_holder_container_iterator

template<class Type , template< class ... > class ContainerType>
typedef traits::holder_const_container_iterator matador::const_container_iterator< Type, ContainerType >::const_holder_container_iterator

Shortcut to the internal const container iterator

◆ difference_type

template<class Type , template< class ... > class ContainerType>
typedef traits::difference_type matador::const_container_iterator< Type, ContainerType >::difference_type

Shortcut to the difference type

◆ holder_container_iterator

template<class Type , template< class ... > class ContainerType>
typedef traits::holder_container_iterator matador::const_container_iterator< Type, ContainerType >::holder_container_iterator

Shortcut to the internal container iterator

◆ holder_type

template<class Type , template< class ... > class ContainerType>
typedef traits::holder_type matador::const_container_iterator< Type, ContainerType >::holder_type

Shortcut to the relation type

◆ self

template<class Type , template< class ... > class ContainerType>
typedef const_container_iterator<Type, ContainerType> matador::const_container_iterator< Type, ContainerType >::self

Shortcut value self

◆ value_type

template<class Type , template< class ... > class ContainerType>
typedef traits::value_type matador::const_container_iterator< Type, ContainerType >::value_type

Shortcut value type

Constructor & Destructor Documentation

◆ const_container_iterator() [1/4]

template<class Type , template< class ... > class ContainerType>
matador::const_container_iterator< Type, ContainerType >::const_container_iterator ( holder_container_iterator  iter)
inlineexplicit

Creates a const has many iterator from given internal container iterator.

Parameters
iterThe iterator to create the const has many iterator from

◆ const_container_iterator() [2/4]

template<class Type , template< class ... > class ContainerType>
matador::const_container_iterator< Type, ContainerType >::const_container_iterator ( const_holder_container_iterator  iter)
inlineexplicit

Creates a const has many iterator from given internal const container iterator.

Parameters
iterThe const iterator to create the const has many iterator from

◆ const_container_iterator() [3/4]

template<class Type , template< class ... > class ContainerType>
matador::const_container_iterator< Type, ContainerType >::const_container_iterator ( const container_iterator< Type, ContainerType > &  iter)
inline

Creates a const has many iterator from a has many iterator.

Parameters
iterThe iterator to create the const has many iterator from

◆ const_container_iterator() [4/4]

template<class Type , template< class ... > class ContainerType>
matador::const_container_iterator< Type, ContainerType >::const_container_iterator ( const self iter)
inline

Copy construct a const_has_many_iterator from given iterator.

Parameters
iterIterator to copy construct from.

Member Function Documentation

◆ operator!=()

template<class Type , template< class ... > class ContainerType>
bool matador::const_container_iterator< Type, ContainerType >::operator!= ( const self i) const
inline

Compares unequality iterator with another iterator.

Compares iterator with another iterator. If other iterator doesn't contain the same element true es returned.

Parameters
iThe iterator to compare with
Returns
True if iterators doesn't contain the same element

◆ operator*()

template<class Type , template< class ... > class ContainerType>
const value_type & matador::const_container_iterator< Type, ContainerType >::operator* ( ) const
inline

Return a const reference to the current value represented by the iterator

Returns
The current value

◆ operator+()

template<class Type , template< class ... > class ContainerType>
self matador::const_container_iterator< Type, ContainerType >::operator+ ( difference_type  offset) const
inline

Increments iterator with offset.

Parameters
offsetThe offset to be incremented
Returns
New incremented iterator

◆ operator++() [1/2]

template<class Type , template< class ... > class ContainerType>
self & matador::const_container_iterator< Type, ContainerType >::operator++ ( )
inline

Pre increments self.

Returns
A reference to incremented self

◆ operator++() [2/2]

template<class Type , template< class ... > class ContainerType>
self matador::const_container_iterator< Type, ContainerType >::operator++ ( int  )
inline

Post increments iterator.

Post increments iterator and returns a new iterator object.

Returns
Returns new incremented iterator

◆ operator+=()

template<class Type , template< class ... > class ContainerType>
self & matador::const_container_iterator< Type, ContainerType >::operator+= ( difference_type  offset)
inline

Increments iterator with offset.

Parameters
offsetThe offset to be incremented
Returns
Reference to incremented iterator

◆ operator-()

template<class Type , template< class ... > class ContainerType>
self matador::const_container_iterator< Type, ContainerType >::operator- ( difference_type  offset) const
inline

Decrements iterator with offset.

Parameters
offsetThe offset to be decremented
Returns
New decremented iterator

◆ operator--() [1/2]

template<class Type , template< class ... > class ContainerType>
self & matador::const_container_iterator< Type, ContainerType >::operator-- ( )
inline

Pre decrements self.

Returns
A reference to decremented self

◆ operator--() [2/2]

template<class Type , template< class ... > class ContainerType>
self matador::const_container_iterator< Type, ContainerType >::operator-- ( int  )
inline

Post decrements iterator.

Post decrements iterator and returns a new iterator object.

Returns
Returns new decremented iterator

◆ operator-=()

template<class Type , template< class ... > class ContainerType>
self & matador::const_container_iterator< Type, ContainerType >::operator-= ( difference_type  offset)
inline

Decrements iterator with offset.

Parameters
offsetThe offset to be decremented
Returns
Reference to decremented iterator

◆ operator->()

template<class Type , template< class ... > class ContainerType>
const value_type matador::const_container_iterator< Type, ContainerType >::operator-> ( ) const
inline

Return the current value represented by the iterator

Returns
The current value

◆ operator<()

template<class Type , template< class ... > class ContainerType>
bool matador::const_container_iterator< Type, ContainerType >::operator< ( const self i) const
inline

Compares less than iterator with another iterator.

Compares iterator with another iterator. If other iterator isn't less than this iterator true es returned.

Parameters
iThe iterator to compare with
Returns
True if iterators isn't less than this itertor

◆ operator=() [1/2]

template<class Type , template< class ... > class ContainerType>
const_container_iterator & matador::const_container_iterator< Type, ContainerType >::operator= ( const container_iterator< Type, ContainerType > &  iter)
inline

Copy assigns a new const has many iterator.

Copy assigns a new const has many iterator from a non const has many iterator

Parameters
iterThe iterator to be copy assigned from
Returns
Reference to the created iterator

◆ operator=() [2/2]

template<class Type , template< class ... > class ContainerType>
const_container_iterator & matador::const_container_iterator< Type, ContainerType >::operator= ( const self iter)
inline

Copy assigns a new const has many iterator.

Parameters
iterThe iterator to be copy assigned from
Returns
Reference to the created iterator

◆ operator==()

template<class Type , template< class ... > class ContainerType>
bool matador::const_container_iterator< Type, ContainerType >::operator== ( const self i) const
inline

Compares equality iterator with another iterator.

Compares iterator with another iterator. If other iterator contain the same element true es returned.

Parameters
iThe iterator to compare with
Returns
True if iterators contain the same element

Friends And Related Symbol Documentation

◆ operator+

template<class Type , template< class ... > class ContainerType>
const self operator+ ( difference_type  offset,
self  out 
)
friend

Increment given iterator with the given offset.

Parameters
offsetIncrement offset value
outIterator to increment
Returns
Incremented iterator

◆ operator-

template<class Type , template< class ... > class ContainerType>
difference_type operator- ( self  a,
self  b 
)
friend

Returns the difference of two iterators a and b.

Parameters
aThe minuend iterator
bThe subtrahend iterator
Returns
The difference between both iterators

The documentation for this class was generated from the following file:
  • matador/object/container_iterator.hpp