mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator Class Reference

bidirectional iterator (non const) More...

#include <TStaticArray.h>

Inheritance diagram for mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator:

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

Collaboration graph
{std::iterator\<std::random_access_iterator_tag, value_type, difference_type, pointer, reference\>\n||}{mbo::TStaticArray\< __ValueType, __MaxSize, __Allocator \>\n|# m_alloc\l# m_nSize\l# m_acValues\l- m_acData\l|+ TStaticArray()\l+ TStaticArray()\l+ TStaticArray()\l+ ~TStaticArray()\l+ capacity()\l+ size()\l+ resize()\l+ resize()\l+ limit_size()\l+ reserve()\l+ empty()\l+ full()\l+ at()\l+ at()\l+ operator[]()\l+ operator[]()\l+ front()\l+ front()\l+ back()\l+ back()\l+ push_back()\l+ pop_back()\l+ append()\l+ append_element()\l+ clear()\l+ begin()\l+ begin()\l+ end()\l+ end()\l+ final()\l+ final()\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
bool operator!= (const iterator &rhs) const throw ( logic_error )
iteratoroperator= (const iterator &rhs)
reference operator[] (size_type nPos) throw ( out_of_range )
const_reference operator[] (size_type nPos) 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

Friends

class const_iterator


Detailed Description

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
class mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator

bidirectional iterator (non const)

Definition at line 417 of file TStaticArray.h.


Constructor & Destructor Documentation

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::iterator ( _MyType array,
size_type  pos = 0 
) [inline, explicit]

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

Definition at line 431 of file TStaticArray.h.

00435             : m_array(array), m_pos(pos)

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::iterator ( const iterator oth  )  [inline]

Parameters:
oth other iterator to copy

Definition at line 438 of file TStaticArray.h.

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


Member Function Documentation

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator const_iterator (  )  [inline]

Returns:
conversion to const_iterator

Definition at line 445 of file TStaticArray.h.

00449         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
const_reference mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator * (  )  const [inline]

Returns:
current data as const reference

Definition at line 452 of file TStaticArray.h.

00456         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
reference mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator * (  )  [inline]

Returns:
current data as non const reference

Definition at line 459 of file TStaticArray.h.

00463         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
const_pointer mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator-> (  )  const [inline]

Returns:
current data as const pointer

Definition at line 466 of file TStaticArray.h.

References operator *().

00470         {

Here is the call graph for this function:

operator *

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
pointer mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator-> (  )  [inline]

Returns:
current data as non const pointer

Definition at line 473 of file TStaticArray.h.

References operator *().

00477         {

Here is the call graph for this function:

operator *

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator++ (  )  [inline]

move forward

Returns:
modified self

Definition at line 481 of file TStaticArray.h.

00485         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator++ ( int   )  [inline]

move forward

Returns:
copy of original iterator before moving

Definition at line 490 of file TStaticArray.h.

00494         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator-- (  )  [inline]

move backward

Returns:
modified self

Definition at line 499 of file TStaticArray.h.

00503         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator-- ( int   )  [inline]

move backward

Returns:
copy of original iterator before moving

Definition at line 508 of file TStaticArray.h.

00512         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator== ( const iterator rhs  )  const [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 519 of file TStaticArray.h.

00523         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 530 of file TStaticArray.h.

00534         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 539 of file TStaticArray.h.

00543         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
reference mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator[] ( size_type  nPos  )  throw ( out_of_range ) [inline]

Parameters:
nPos 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 549 of file TStaticArray.h.

00553         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
const_reference mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::operator[] ( size_type  nPos  )  const throw ( out_of_range ) [inline]

Parameters:
nPos 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 558 of file TStaticArray.h.

00562         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
difference_type mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 568 of file TStaticArray.h.

00572         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 579 of file TStaticArray.h.

00583         {
00584 #if _MSC_VER >= 1300
00585 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00586 #endif
00587             mbo_ta_throw_if_not(logic_error, m_pos >= diff);
00588             m_pos -= diff;
00589 #if _MSC_VER >= 1300
00590 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 597 of file TStaticArray.h.

00601         {
00602 #if _MSC_VER >= 1300
00603 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00604 #endif
00605             mbo_tsa_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00606             m_pos += diff;
00607 #if _MSC_VER >= 1300
00608 # pragma warning(default: 4018)

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 615 of file TStaticArray.h.

00619         {
00620 #if _MSC_VER >= 1300
00621 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00622 #endif
00623             mbo_tsa_throw_if_not(logic_error, m_pos >= diff);
00624             return iterator(m_array, m_pos - diff);
00625 #if _MSC_VER >= 1300

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
iterator mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 632 of file TStaticArray.h.

00636         {
00637 #if _MSC_VER >= 1300
00638 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00639 #endif
00640             mbo_tsa_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00641             return iterator(m_array, m_pos + diff);
00642 #if _MSC_VER >= 1300

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 649 of file TStaticArray.h.

00653         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 660 of file TStaticArray.h.

00664         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 671 of file TStaticArray.h.

00675         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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 682 of file TStaticArray.h.

00686         {


Friends And Related Function Documentation

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
friend class const_iterator [friend]

Definition at line 426 of file TStaticArray.h.


Member Data Documentation

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
_MyType& mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::m_array [protected]

reference to array

Definition at line 689 of file TStaticArray.h.

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
size_type mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::iterator::m_pos [protected]

current position

Definition at line 690 of file TStaticArray.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:15 2008 for MBO-lib by doxygen 1.5.4