Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Types | Public Member Functions
ext::virtual_pointer_to_integer< IntegralType > Class Template Reference

Class wrapping an integral type, but with pointer iterface. More...

#include <foreach.hpp>

Public Types

typedef IntegralType value_type
 
typedef std::ptrdiff_t difference_type
 
typedef IntegralType * pointer
 
typedef IntegralType reference
 
typedef std::bidirectional_iterator_tag iterator_category
 

Public Member Functions

 virtual_pointer_to_integer (IntegralType data)
 Constructor of the virtual pointer class. More...
 
IntegralType operator* () const
 Method to retrieve the integral value. More...
 
virtual_pointer_to_integeroperator++ ()
 Prefix increment operator to increment the hold value. More...
 
virtual_pointer_to_integeroperator-- ()
 Prefix decrement operator to decrement the hold value. More...
 
virtual_pointer_to_integer operator++ (int)
 Postfix increment operator to increment the hold value. More...
 
virtual_pointer_to_integer operator-- (int)
 Postfix decrement operator to decrement the hold value. More...
 
bool operator== (const virtual_pointer_to_integer< IntegralType > &other) const
 Equality operator. Two classes are equal if the data they hold is the same. More...
 
bool operator!= (const virtual_pointer_to_integer< IntegralType > &other) const
 Inequality operator. Two classes are not equal if the data they hold is different. More...
 

Detailed Description

template<class IntegralType>
class ext::virtual_pointer_to_integer< IntegralType >

Class wrapping an integral type, but with pointer iterface.

Template Parameters
IntegralTypethe type of values the iterator provides

Member Typedef Documentation

◆ difference_type

template<class IntegralType >
typedef std::ptrdiff_t ext::virtual_pointer_to_integer< IntegralType >::difference_type

◆ iterator_category

template<class IntegralType >
typedef std::bidirectional_iterator_tag ext::virtual_pointer_to_integer< IntegralType >::iterator_category

◆ pointer

template<class IntegralType >
typedef IntegralType* ext::virtual_pointer_to_integer< IntegralType >::pointer

◆ reference

template<class IntegralType >
typedef IntegralType ext::virtual_pointer_to_integer< IntegralType >::reference

◆ value_type

template<class IntegralType >
typedef IntegralType ext::virtual_pointer_to_integer< IntegralType >::value_type

Constructor & Destructor Documentation

◆ virtual_pointer_to_integer()

template<class IntegralType >
ext::virtual_pointer_to_integer< IntegralType >::virtual_pointer_to_integer ( IntegralType  data)
inline

Constructor of the virtual pointer class.

Parameters
datathe value to hold

Member Function Documentation

◆ operator!=()

template<class IntegralType >
bool ext::virtual_pointer_to_integer< IntegralType >::operator!= ( const virtual_pointer_to_integer< IntegralType > &  other) const
inline

Inequality operator. Two classes are not equal if the data they hold is different.

Parameters
otherthe other instance to compare with
Returns
bool true if this and other classes hold different value

◆ operator*()

template<class IntegralType >
IntegralType ext::virtual_pointer_to_integer< IntegralType >::operator* ( ) const
inline

Method to retrieve the integral value.

Returns
the current value

◆ operator++() [1/2]

template<class IntegralType >
virtual_pointer_to_integer & ext::virtual_pointer_to_integer< IntegralType >::operator++ ( )
inline

Prefix increment operator to increment the hold value.

Returns
this

◆ operator++() [2/2]

template<class IntegralType >
virtual_pointer_to_integer ext::virtual_pointer_to_integer< IntegralType >::operator++ ( int  )
inline

Postfix increment operator to increment the hold value.

Returns
original value

◆ operator--() [1/2]

template<class IntegralType >
virtual_pointer_to_integer & ext::virtual_pointer_to_integer< IntegralType >::operator-- ( )
inline

Prefix decrement operator to decrement the hold value.

Returns
this

◆ operator--() [2/2]

template<class IntegralType >
virtual_pointer_to_integer ext::virtual_pointer_to_integer< IntegralType >::operator-- ( int  )
inline

Postfix decrement operator to decrement the hold value.

Returns
original value

◆ operator==()

template<class IntegralType >
bool ext::virtual_pointer_to_integer< IntegralType >::operator== ( const virtual_pointer_to_integer< IntegralType > &  other) const
inline

Equality operator. Two classes are equal if the data they hold is the same.

Parameters
otherthe other instance to compare with
Returns
bool true if this and other classes hold the same value

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