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

constant bidirectional iterator More...

#include <TDynamicArray.h>

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

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

Collaboration graph
{std::iterator\<std::random_access_iterator_tag, value_type, difference_type, const_pointer, const_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

 const_iterator (const _MyType &array, size_type pos=0)
 const_iterator (const const_iterator &oth)
 const_iterator (const iterator &oth)
const_reference operator * () const
const_pointer operator-> () const
const_iteratoroperator++ ()
const_iterator operator++ (int)
const_iteratoroperator-- ()
const_iterator operator-- (int)
bool operator== (const const_iterator &rhs) const throw ( logic_error )
bool operator!= (const const_iterator &rhs) const throw ( logic_error )
const_iteratoroperator= (const const_iterator &rhs)
const_reference operator[] (size_type pos) const throw ( out_of_range )
difference_type operator- (const const_iterator &rhs) const throw ( logic_error )
const_iteratoroperator-= (difference_type diff) throw ( logic_error )
const_iteratoroperator+= (difference_type diff) throw ( logic_error )
const_iterator operator- (difference_type diff) const throw ( logic_error )
const_iterator operator+ (difference_type diff) const throw ( logic_error )
bool operator< (const const_iterator &rhs) const throw ( logic_error )
bool operator> (const const_iterator &rhs) const throw ( logic_error )
bool operator<= (const const_iterator &rhs) const throw ( logic_error )
bool operator>= (const const_iterator &rhs) const throw ( logic_error )

Protected Attributes

const _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 >::const_iterator

constant bidirectional iterator

Definition at line 151 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 >::const_iterator::const_iterator ( const _MyType array,
size_type  pos = 0 
) [inline, explicit]

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

Definition at line 164 of file TDynamicArray.h.

00167             : 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 >::const_iterator::const_iterator ( const const_iterator oth  )  [inline]

Parameters:
oth other iterator to copy

Definition at line 171 of file TDynamicArray.h.

00174             : m_array(oth.m_array), m_pos(oth.m_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 >::const_iterator::const_iterator ( const iterator oth  )  [inline]

Parameters:
oth other iterator to copy

Definition at line 178 of file TDynamicArray.h.

00181             : 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>
const_reference mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_iterator::operator * (  )  const [inline]

Returns:
current data as const reference

Definition at line 185 of file TDynamicArray.h.

00188         {

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 >::const_iterator::operator-> (  )  const [inline]

Returns:
current data as const pointer

Definition at line 192 of file TDynamicArray.h.

00195         {

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

move forward

Returns:
modified self

Definition at line 200 of file TDynamicArray.h.

00203         {
00204             ++m_pos;

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

move forward

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

Definition at line 210 of file TDynamicArray.h.

00213         {
00214             /* postfix operator return an unchanged copy prior to the operaration */

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

move frontward

Returns:
modified self

Definition at line 219 of file TDynamicArray.h.

00222         {
00223             --m_pos;

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

move frontward

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

Definition at line 229 of file TDynamicArray.h.

00232         {
00233             /* postfix operator return an unchanged copy prior to the operaration */

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 >::const_iterator::operator== ( const 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 oth references different container

Definition at line 240 of file TDynamicArray.h.

00243         {
00244             mbo_tda_throw_if_not(logic_error, &m_array == &rhs.m_array);

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 >::const_iterator::operator!= ( const 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 251 of file TDynamicArray.h.

00254         {

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_iterator::operator= ( const 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 260 of file TDynamicArray.h.

00263         {
00264             new (this) const_iterator(rhs.m_array, rhs.m_pos);

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 >::const_iterator::operator[] ( size_type  pos  )  const throw ( out_of_range ) [inline]

Parameters:
pos position 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 270 of file TDynamicArray.h.

00273         {

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 >::const_iterator::operator- ( const 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 280 of file TDynamicArray.h.

00283         {
00284             mbo_tda_throw_if_not(logic_error, &m_array == &rhs.m_array);

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_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 291 of file TDynamicArray.h.

00294         {
00295 #if defined(_MSC_VER) && _MSC_VER >= 1300
00296 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00297 #endif
00298             mbo_tda_throw_if_not(logic_error, m_pos >= diff);
00299             m_pos -= diff;
00300 #if defined(_MSC_VER) && _MSC_VER >= 1300
00301 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00302 #endif

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_iterator& mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_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 309 of file TDynamicArray.h.

00312         {
00313 #if defined(_MSC_VER) && _MSC_VER >= 1300
00314 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00315 #endif
00316             mbo_tda_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00317             m_pos += diff;
00318 #if defined(_MSC_VER) && _MSC_VER >= 1300
00319 # pragma warning(default: 4018)
00320 #endif

template<class __ValueType, class __Allocator = mem_reallocator<__ValueType>, typename __Allocator::size_type __MinSize = 8, typename __Allocator::size_type __Append = 8>
const_iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_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 327 of file TDynamicArray.h.

00330         {
00331 #if defined(_MSC_VER) && _MSC_VER >= 1300
00332 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00333 #endif
00334             mbo_tda_throw_if_not(logic_error, m_pos >= diff);
00335             return const_iterator(m_array, m_pos - diff);
00336 #if defined(_MSC_VER) && _MSC_VER >= 1300
00337 # 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>
const_iterator mbo::TDynamicArray< __ValueType, __Allocator, __MinSize, __Append >::const_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 344 of file TDynamicArray.h.

00347         {
00348 #if defined(_MSC_VER) && _MSC_VER >= 1300
00349 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00350 #endif
00351             mbo_tda_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00352             return const_iterator(m_array, m_pos + diff);
00353 #if defined(_MSC_VER) && _MSC_VER >= 1300
00354 # pragma warning(default: 4018)

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 >::const_iterator::operator< ( const 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 361 of file TDynamicArray.h.

00364         {
00365             mbo_tda_throw_if_not(logic_error, &m_array == &rhs.m_array);

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 >::const_iterator::operator> ( const 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 372 of file TDynamicArray.h.

00375         {
00376             mbo_tda_throw_if_not(logic_error, &m_array == &rhs.m_array);

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 >::const_iterator::operator<= ( const 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 383 of file TDynamicArray.h.

00386         {
00387             mbo_tda_throw_if_not(logic_error, &m_array == &rhs.m_array);

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 >::const_iterator::operator>= ( const 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 394 of file TDynamicArray.h.

00397         {
00398             mbo_tda_throw_if_not(logic_error, &m_array == &rhsrhs.m_array);


Member Data Documentation

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

reference to array

Definition at line 401 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 >::const_iterator::m_pos [protected]

current position

Definition at line 402 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