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

Represents a has many iterator. More...

#include <container_iterator.hpp>

Public Types

typedef 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 holder_const_container_iterator
 

Public Member Functions

 container_iterator ()=default
 Creates an empty has many iterator.
 
 container_iterator (const self &iter)
 Copy constructs an iterator from another iterator.
 
 container_iterator (holder_container_iterator iter)
 Creates a has many iterator from given internal container iterator.
 
container_iteratoroperator= (const self &iter)
 Copy assign an iterator from another iterator.
 
bool operator== (const self &i) const
 Compares equality iterator with another iterator.
 
bool operator!= (const self &i) const
 Compares inequality 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)
 Increments iterator with offset.
 
self operator- (difference_type offset)
 Decrements iterator with offset.
 
value_type operator-> () const
 
value_typeoperator* () const
 
holder_typeholder_item () const
 Returns the holder item.
 

Friends

class container< Type, ContainerType >
 
class const_container_iterator< Type, ContainerType >
 
class basic_container< Type, ContainerType >
 
class object_serializer
 
class detail::object_inserter
 
class detail::object_deleter
 
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::container_iterator< Type, ContainerType >

Represents a has many iterator.

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

Template Parameters
TypeThe type of the iterator/container

Member Typedef Documentation

◆ difference_type

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

Shortcut to the difference type

◆ holder_const_container_iterator

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

Shortcut to the internal const container iterator

◆ holder_container_iterator

template<class Type , template< class ... > class ContainerType>
typedef traits::holder_container_iterator matador::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::container_iterator< Type, ContainerType >::holder_type

Shortcut to the relation type

◆ self

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

Shortcut value self

◆ value_type

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

Shortcut value type

Constructor & Destructor Documentation

◆ container_iterator() [1/2]

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

Copy constructs an iterator from another iterator.

Parameters
iterThe iterator to copy from

◆ container_iterator() [2/2]

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

Creates a has many iterator from given internal container iterator.

Parameters
iterThe iterator to create the has many iterator from

Member Function Documentation

◆ holder_item()

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

Returns the holder item.

Returns the holder item representing one half of the relation table

Returns
The holder item

◆ operator!=()

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

Compares inequality 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>
value_type & matador::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>
self matador::container_iterator< Type, ContainerType >::operator+ ( difference_type  offset)
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::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::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::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::container_iterator< Type, ContainerType >::operator- ( difference_type  offset)
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::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::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::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>
value_type matador::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::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 iterator

◆ operator=()

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

Copy assign an iterator from another iterator.

Parameters
iterThe iterator to copy from
Returns
A reference to self

◆ operator==()

template<class Type , template< class ... > class ContainerType>
bool matador::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