mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator Class Reference

bidirectional iterator (non const) More...

#include <TDynamicArray.h>

Inheritance diagram for mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator:

Inheritance graph
{std::iterator\<std::random_access_iterator_tag, value_type, difference_type, pointer, reference\>\n||}
[legend]
Collaboration diagram for mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator:

Collaboration graph
{std::iterator\<std::random_access_iterator_tag, value_type, difference_type, pointer, reference\>\n||}{mbo::TDynamicArray\< __ValueType, __Allocator, __MinSize, __Append \>\n|# m_alloc\l# m_nSize\l# m_nCapacity\l# m_nAppend\l# m_nMaxSize\l# m_acValues\l|+ TDynamicArray()\l+ TDynamicArray()\l+ operator=()\l+ ~TDynamicArray()\l+ size()\l+ empty()\l+ capacity()\l+ max_size()\l+ append()\l+ operator[]()\l+ operator[]()\l+ at()\l+ at()\l+ back()\l+ back()\l+ front()\l+ front()\l+ push_front()\l+ pop_front()\l+ push_back()\l+ pop_back()\l+ begin()\l+ begin()\l+ end()\l+ end()\l+ rbegin()\l+ rbegin()\l+ rend()\l+ rend()\l+ assign()\l+ assign()\l+ erase()\l+ erase()\l+ erase()\l+ clear()\l+ reserve()\l+ resize()\l+ resize()\l+ limit_size()\l# check_resize()\l# delete_at()\l# insert_at()\l}{mbo::allocator\< __ValueType, __ReferenceType \>\n||+ address()\l+ address()\l+ allocate()\l+ deallocate()\l+ construct()\l+ max_size()\l}
[legend]

List of all members.

Public Member Functions

 iterator (_MyType &array, size_type pos=0)
 iterator (const iterator &oth)
 operator const_iterator ()
 
Returns:
conversion to const_iterator

const_reference operator * () const
reference operator * ()
const_pointer operator-> () const
pointer operator-> ()
iteratoroperator++ ()
iterator operator++ (int)
iteratoroperator-- ()
iterator operator-- (int)
bool operator== (const iterator &rhs) const throw ( logic_error )
bool operator!= (const iterator &rhs) const throw ( logic_error )
iteratoroperator= (const iterator &rhs)
reference operator[] (size_type pos) throw ( out_of_range )
const_reference operator[] (size_type pos) const throw ( out_of_range )
difference_type operator- (const iterator &rhs) const throw ( logic_error )
iteratoroperator-= (difference_type diff) throw ( logic_error )
iteratoroperator+= (difference_type diff) throw ( logic_error )
iterator operator- (difference_type diff) const throw ( logic_error )
iterator operator+ (difference_type diff) const throw ( logic_error )
bool operator< (const iterator &rhs) const throw ( logic_error )
bool operator> (const iterator &rhs) const throw ( logic_error )
bool operator<= (const iterator &rhs) const throw ( logic_error )
bool operator>= (const iterator &rhs) const throw ( logic_error )

Protected Attributes

_MyTypem_array
size_type m_pos


Detailed Description

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
class mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator

bidirectional iterator (non const)

Definition at line 407 of file TDynamicArray.h.


Constructor & Destructor Documentation

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::iterator ( _MyType array,
size_type  pos = 0 
) [inline, explicit]

Parameters:
array const reference to array
pos index of start position

Definition at line 420 of file TDynamicArray.h.

00424             : m_array(array), m_pos(pos)

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::iterator ( const iterator oth  )  [inline, explicit]

Parameters:
oth other iterator to copy

Definition at line 427 of file TDynamicArray.h.

00431             : m_array(oth.m_array), m_pos(oth.m_pos)


Member Function Documentation

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator const_iterator (  )  [inline]

Returns:
conversion to const_iterator

Definition at line 434 of file TDynamicArray.h.

00438         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_reference mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator * (  )  const [inline]

Returns:
current data as const reference

Definition at line 441 of file TDynamicArray.h.

00445         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
reference mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator * (  )  [inline]

Returns:
current data as non const reference

Definition at line 448 of file TDynamicArray.h.

00452         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_pointer mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator-> (  )  const [inline]

Returns:
current data as const pointer

Definition at line 455 of file TDynamicArray.h.

References operator *().

00459         {

Here is the call graph for this function:

operator *

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
pointer mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator-> (  )  [inline]

Returns:
current data as non const pointer

Definition at line 462 of file TDynamicArray.h.

References operator *().

00466         {

Here is the call graph for this function:

operator *

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator++ (  )  [inline]

move forward

Returns:
modified self

Definition at line 470 of file TDynamicArray.h.

00474         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator++ ( int   )  [inline]

move forward

Returns:
copy of original iterator before moving
Deprecated:
use prefix operator++()

Definition at line 480 of file TDynamicArray.h.

00484         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator-- (  )  [inline]

move frontward

Returns:
modified self

Definition at line 489 of file TDynamicArray.h.

00493         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator-- ( int   )  [inline]

move frontward

Returns:
copy of original iterator before moving
Deprecated:
use prefix operator--()

Definition at line 499 of file TDynamicArray.h.

00503         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator== ( const iterator rhs  )  const throw ( logic_error ) [inline]

EQ: equality operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether the two iterators are equal
Exceptions:
logic_error if rhs references different container

Definition at line 510 of file TDynamicArray.h.

00514         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator!= ( const iterator rhs  )  const throw ( logic_error ) [inline]

NE: non-equality operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether the two iterators are different
Exceptions:
logic_error if rhs references different container

Definition at line 521 of file TDynamicArray.h.

00525         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator= ( const iterator rhs  )  [inline]

assignment (copies array reference and position)

Parameters:
rhs right hand side argument (iterator to copy)
Returns:
modified this

Definition at line 530 of file TDynamicArray.h.

00534         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
reference mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator[] ( size_type  pos  )  throw ( out_of_range ) [inline]

Parameters:
pos index of element to access (read/write)
Returns:
const reference to value at specified index
Exceptions:
out_of_range if index is invalid

Definition at line 540 of file TDynamicArray.h.

00544         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_reference mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator[] ( size_type  pos  )  const throw ( out_of_range ) [inline]

Parameters:
pos index of element to access (read only)
Returns:
const reference to value at specified index
Exceptions:
out_of_range if index is invalid

Definition at line 549 of file TDynamicArray.h.

00553         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
difference_type mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator- ( const iterator rhs  )  const throw ( logic_error ) [inline]

Compute distance of to iterators

Parameters:
rhs other iterator
Returns:
distance between this and rhs
Exceptions:
logic_error if rhs references different container

Definition at line 559 of file TDynamicArray.h.

00563         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator-= ( difference_type  diff  )  throw ( logic_error ) [inline]

Decrease position

Parameters:
diff number of elements to go front
Returns:
modified self
Exceptions:
logic_error if new position is in back of array

Definition at line 570 of file TDynamicArray.h.

00574         {
00575 #if defined(_MSC_VER) && _MSC_VER >= 1300
00576 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00577 #endif
00578             mbo_tda_throw_if_not(logic_error, m_pos >= diff);
00579             m_pos -= diff;
00580 #if defined(_MSC_VER) && _MSC_VER >= 1300
00581 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator+= ( difference_type  diff  )  throw ( logic_error ) [inline]

Increase position

Parameters:
diff number of elements to go forth
Returns:
modified self
Exceptions:
logic_error if new position is invalid

Definition at line 588 of file TDynamicArray.h.

00592         {
00593 #if defined(_MSC_VER) && _MSC_VER >= 1300
00594 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00595 #endif
00596             mbo_tda_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00597             m_pos += diff;
00598 #if defined(_MSC_VER) && _MSC_VER >= 1300
00599 # pragma warning(default: 4018)

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator- ( difference_type  diff  )  const throw ( logic_error ) [inline]

Create iterator in back of current

Parameters:
diff number of elements to go front
Returns:
new iterator
Exceptions:
logic_error if new position is in back of array

Definition at line 606 of file TDynamicArray.h.

00610         {
00611 #if defined(_MSC_VER) && _MSC_VER >= 1300
00612 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00613 #endif
00614             mbo_tda_throw_if_not(logic_error, m_pos >= diff);
00615             return iterator(m_array, m_pos - diff);
00616 #if defined(_MSC_VER) && _MSC_VER >= 1300

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator+ ( difference_type  diff  )  const throw ( logic_error ) [inline]

Create iterator behind current

Parameters:
diff number of elements to go forth
Returns:
new iterator
Exceptions:
logic_error if new position is invalid

Definition at line 623 of file TDynamicArray.h.

00627         {
00628 #if defined(_MSC_VER) && _MSC_VER >= 1300
00629 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00630 #endif
00631             mbo_tda_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00632             return iterator(m_array, m_pos + diff);
00633 #if defined(_MSC_VER) && _MSC_VER >= 1300

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator< ( const iterator rhs  )  const throw ( logic_error ) [inline]

LT: less than operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether this < rhs
Exceptions:
logic_error if rhs references different container

Definition at line 640 of file TDynamicArray.h.

00644         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator> ( const iterator rhs  )  const throw ( logic_error ) [inline]

GT: greater than operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether this > rhs
Exceptions:
logic_error if rhs references different container

Definition at line 651 of file TDynamicArray.h.

00655         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator<= ( const iterator rhs  )  const throw ( logic_error ) [inline]

LE: less than or equal operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether this <= rhs
Exceptions:
logic_error if rhs references different container

Definition at line 662 of file TDynamicArray.h.

00666         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
bool mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::operator>= ( const iterator rhs  )  const throw ( logic_error ) [inline]

GT: greate than or equal operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether this >= rhs
Exceptions:
logic_error if rhs references different container

Definition at line 673 of file TDynamicArray.h.

00677         {


Member Data Documentation

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
_MyType& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::m_array [protected]

reference to array

Definition at line 680 of file TDynamicArray.h.

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
size_type mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::iterator::m_pos [protected]

current position

Definition at line 681 of file TDynamicArray.h.


The documentation for this class was generated from the following file:
  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:14 2008 for MBO-lib by doxygen 1.5.4