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

constant bidirectional iterator More...

#include <TStaticArray.h>

Inheritance diagram for mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::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::TStaticArray< __ValueType, __MaxSize, __Allocator >::const_iterator:

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

 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
bool operator== (const iterator &rhs) const throw ( logic_error )
bool operator!= (const iterator &rhs) const
const_iteratoroperator= (const const_iterator &rhs)
const_reference operator[] (size_type nPos) 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, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
class mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::const_iterator

constant bidirectional iterator

Definition at line 138 of file TStaticArray.h.


Constructor & Destructor Documentation

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

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

Definition at line 150 of file TStaticArray.h.

00153             : m_array(array), m_pos(pos)

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

Parameters:
oth other iterator to copy

Definition at line 157 of file TStaticArray.h.

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

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

Parameters:
oth other iterator to copy

Definition at line 164 of file TStaticArray.h.

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


Member Function Documentation

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

Returns:
current data as const reference

Definition at line 171 of file TStaticArray.h.

00174         {

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

Returns:
current data as const pointer

Definition at line 178 of file TStaticArray.h.

00181         {

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

move forward

Returns:
modified self

Definition at line 186 of file TStaticArray.h.

00189         {
00190             ++m_pos;

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

move forward

Returns:
copy of original iterator before moving

Definition at line 195 of file TStaticArray.h.

00198         {
00199             /* postfix operator return an unchanged copy prior to the operaration */

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

move backward

Returns:
modified self

Definition at line 204 of file TStaticArray.h.

00207         {
00208             --m_pos;

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

move backward

Returns:
copy of original iterator before moving

Definition at line 213 of file TStaticArray.h.

00216         {
00217             /* postfix operator return an unchanged copy prior to the operaration */

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

00227         {
00228             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

NE: non-equality operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether the two iterators are different

Definition at line 234 of file TStaticArray.h.

00237         {

template<class __ValueType, size_t __MaxSize, class __Allocator = std::allocator<__ValueType>>
bool mbo::TStaticArray< __ValueType, __MaxSize, __Allocator >::const_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 oth references different container

Definition at line 244 of file TStaticArray.h.

00247         {
00248             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

NE: non-equality operator

Parameters:
rhs right hand side argument (other iterator)
Returns:
whether the two iterators are different

Definition at line 254 of file TStaticArray.h.

00257         {

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

00266         {
00267 #if _MSC_VER >= 1300
00268 # pragma push_macro("new")
00269 # undef new
00270 #endif
00271             new (this) const_iterator(rhs.m_array, rhs.m_pos);
00272 #if _MSC_VER >= 1300
00273 # pragma pop_macro("new")
00274 #endif

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

00283         {

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

00293         {
00294             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

00304         {
00305 #if _MSC_VER >= 1300
00306 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00307 #endif
00308             mbo_tsa_throw_if_not(logic_error, m_pos >= diff);
00309             m_pos -= diff;
00310 #if _MSC_VER >= 1300
00311 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00312 #endif

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

00322         {
00323 #if _MSC_VER >= 1300
00324 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00325 #endif
00326             mbo_tsa_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00327             m_pos += diff;
00328 #if _MSC_VER >= 1300
00329 # pragma warning(default: 4018)
00330 #endif

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

00340         {
00341 #if _MSC_VER >= 1300
00342 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00343 #endif
00344             mbo_tsa_throw_if_not(logic_error, m_pos >= diff);
00345             return const_iterator(m_array, m_pos - diff);
00346 #if _MSC_VER >= 1300
00347 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch

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

00357         {
00358 #if _MSC_VER >= 1300
00359 # pragma warning(disable: 4018) // '>=' : signed/unsigned mismatch
00360 #endif
00361             mbo_tsa_throw_if_not(logic_error, m_pos + diff >= m_pos && m_pos + diff >= diff && m_pos + diff <= m_array.size());
00362             return const_iterator(m_array, m_pos + diff);
00363 #if _MSC_VER >= 1300
00364 # pragma warning(default: 4018)

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

00374         {
00375             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

00385         {
00386             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

00396         {
00397             mbo_tsa_throw_if_not(logic_error, &m_array == &rhs.m_array);

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

00407         {
00408             mbo_tsa_throw_if_not(logic_error, &m_array == &rhsrhs.m_array);


Member Data Documentation

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

reference to array

Definition at line 411 of file TStaticArray.h.

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

current position

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