Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Friends

bdlc::CompactedArray_ConstIterator< TYPE > Class Template Reference

#include <bdlc_compactedarray.h>

List of all members.

Public Types

typedef bsl::ptrdiff_t difference_type
typedef bsl::size_t size_type
typedef TYPE value_type
typedef TYPE * pointer
typedef TYPE & reference
typedef
std::random_access_iterator_tag 
iterator_category

Public Member Functions

 CompactedArray_ConstIterator ()
 CompactedArray_ConstIterator (const CompactedArray_ConstIterator &original)
 ~CompactedArray_ConstIterator ()
CompactedArray_ConstIteratoroperator= (const CompactedArray_ConstIterator &rhs)
CompactedArray_ConstIteratoroperator+= (bsl::ptrdiff_t offset)
CompactedArray_ConstIteratoroperator-= (bsl::ptrdiff_t offset)
CompactedArray_ConstIteratoroperator++ ()
CompactedArray_ConstIteratoroperator-- ()
const TYPE & operator* () const
const TYPE & operator-> () const
const TYPE & operator[] (bsl::ptrdiff_t offset) const

Friends

class CompactedArray< TYPE >
CompactedArray_ConstIterator operator++ (CompactedArray_ConstIterator &, int)
CompactedArray_ConstIterator operator-- (CompactedArray_ConstIterator &, int)
bool operator== (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
bool operator!= (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
CompactedArray_ConstIterator
< TYPE > 
operator+ (const CompactedArray_ConstIterator< TYPE > &, bsl::ptrdiff_t)
CompactedArray_ConstIterator
< TYPE > 
operator- (const CompactedArray_ConstIterator< TYPE > &, bsl::ptrdiff_t)
bsl::ptrdiff_t operator- (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
bool operator< (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
bool operator<= (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
bool operator> (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)
bool operator>= (const CompactedArray_ConstIterator &, const CompactedArray_ConstIterator &)

Detailed Description

template<class TYPE>
class bdlc::CompactedArray_ConstIterator< TYPE >

This value-semantic class represents a random access iterator providing non-modifiable access to the elements of a CompactedArray. This class provides all functionality of a random access iterator, as defined by the standard, but is not compatible with most standard methods requiring a bidirectional const_iterator.

This class does not perform any bounds checking. Any iterator, it, referencing a CompactedArray array, remains valid while 0 <= it - array.begin() < array.length().

See Component bdlc_compactedarray


Member Typedef Documentation

template<class TYPE>
typedef bsl::ptrdiff_t bdlc::CompactedArray_ConstIterator< TYPE >::difference_type

The type used for the distance

template<class TYPE>
typedef bsl::size_t bdlc::CompactedArray_ConstIterator< TYPE >::size_type

The type used for any function

template<class TYPE>
typedef TYPE bdlc::CompactedArray_ConstIterator< TYPE >::value_type

The type for elements.

template<class TYPE>
typedef TYPE* bdlc::CompactedArray_ConstIterator< TYPE >::pointer

The type of an arbitrary

template<class TYPE>
typedef TYPE& bdlc::CompactedArray_ConstIterator< TYPE >::reference

The type for element

template<class TYPE>
typedef std::random_access_iterator_tag bdlc::CompactedArray_ConstIterator< TYPE >::iterator_category

Constructor & Destructor Documentation

Create a default CompactedArray_ConstIterator. Note that the behavior of most methods is undefined when used on a default-constructed iterator.

template<class TYPE>
bdlc::CompactedArray_ConstIterator< TYPE >::CompactedArray_ConstIterator ( const CompactedArray_ConstIterator< TYPE > &  original  ) 

Create a CompactedArray_ConstIterator having the same value as the specified original object.

template<class TYPE>
bdlc::CompactedArray_ConstIterator< TYPE >::~CompactedArray_ConstIterator (  ) 

Destroy this object.


Member Function Documentation

template<class TYPE>
CompactedArray_ConstIterator& bdlc::CompactedArray_ConstIterator< TYPE >::operator= ( const CompactedArray_ConstIterator< TYPE > &  rhs  ) 

Assign to this iterator the value of the specified rhs iterator, and return a reference providing modifiable access to this iterator.

template<class TYPE>
CompactedArray_ConstIterator& bdlc::CompactedArray_ConstIterator< TYPE >::operator+= ( bsl::ptrdiff_t  offset  ) 

Advance this iterator by the specified offset from the location referenced by this iterator, and return a reference providing modifiable access to this iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() + offset <= array.length().

template<class TYPE>
CompactedArray_ConstIterator& bdlc::CompactedArray_ConstIterator< TYPE >::operator-= ( bsl::ptrdiff_t  offset  ) 

Decrement this iterator by the specified offset from the location referenced by this iterator, and return a reference providing modifiable access to this iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() - offset <= array.length().

template<class TYPE>
CompactedArray_ConstIterator& bdlc::CompactedArray_ConstIterator< TYPE >::operator++ (  ) 

Advance this iterator to refer to the next location in the referenced array, and return a reference to this iterator after the advancement. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length().

template<class TYPE>
CompactedArray_ConstIterator& bdlc::CompactedArray_ConstIterator< TYPE >::operator-- (  ) 

Decrement this iterator to refer to the previous location in the referenced array, and return a reference to this iterator after the decrementation. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != *this and 0 < *this - array.begin().

template<class TYPE>
const TYPE& bdlc::CompactedArray_ConstIterator< TYPE >::operator* (  )  const

Return a const reference to the element referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length().

template<class TYPE>
const TYPE& bdlc::CompactedArray_ConstIterator< TYPE >::operator-> (  )  const

Return a const reference to the element referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length().

template<class TYPE>
const TYPE& bdlc::CompactedArray_ConstIterator< TYPE >::operator[] ( bsl::ptrdiff_t  offset  )  const

Return a const reference to the element at the specified offset from the location referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() + offset < array.length().


Friends And Related Function Documentation

template<class TYPE>
friend class CompactedArray< TYPE > [friend]
template<class TYPE>
CompactedArray_ConstIterator operator++ ( CompactedArray_ConstIterator< TYPE > &  ,
int   
) [friend]

Advance the specified iterator to refer to the next location in the referenced array, and return an iterator referring to the original location (before the advancement). The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != iterator and iterator - array.begin() < array.length().

template<class TYPE>
CompactedArray_ConstIterator operator-- ( CompactedArray_ConstIterator< TYPE > &  ,
int   
) [friend]

Decrement the specified iterator to refer to the previous location in the referenced array, and return an iterator referring to the original location (before the decrementation). The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != iterator and 0 < iterator - array.begin().

template<class TYPE>
bool operator== ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs and rhs iterators have the same value, and false otherwise. Two CompactedArray_ConstIterator iterators have the same value if they both have the default value, or neither has the default value and they reference the same location in the same array.

template<class TYPE>
bool operator!= ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs and rhs iterators do not have the same value, and false otherwise. Two CompactedArray_ConstIterator iterators do not have the same value if one has the default value and the other does not, or neither has the default value and they do not reference the same location in the same array.

template<class TYPE>
CompactedArray_ConstIterator<TYPE> operator+ ( const CompactedArray_ConstIterator< TYPE > &  ,
bsl::ptrdiff_t   
) [friend]
template<class TYPE>
CompactedArray_ConstIterator<TYPE> operator- ( const CompactedArray_ConstIterator< TYPE > &  ,
bsl::ptrdiff_t   
) [friend]

Return an iterator referencing the location at the specified offset from the location referenced by the specified iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != iterator and 0 <= iterator - array.begin() - offset <= array.length().

template<class TYPE>
bsl::ptrdiff_t operator- ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return the number of elements between the specified lhs and rhs as a signed value. The behavior is undefined unless lhs and rhs reference the same array. Note that the return value is positive when a positive number of rhs++ invocations would result in lhs == rhs, and negative when a positive number of rhs-- invocations would result in lhs == rhs.

template<class TYPE>
bool operator< ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs has a value less than the specified rhs, and false otherwise. Iterator lhs has a value less than iterator rhs if 0 < rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array.

template<class TYPE>
bool operator<= ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs has a value less than or equal to the specified rhs, and 'false otherwise. Iterator lhs has a value less than or equal to iterator rhs if 0 <= rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array.

template<class TYPE>
bool operator> ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs has a value greater than the specified rhs, and false otherwise. Iterator lhs has a value greater than iterator rhs if 0 > rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array.

template<class TYPE>
bool operator>= ( const CompactedArray_ConstIterator< TYPE > &  ,
const CompactedArray_ConstIterator< TYPE > &   
) [friend]

Return true if the specified lhs has a value greater or equal than the specified rhs, and false otherwise. Iterator lhs has a value greater than or equal to iterator rhs if 0 >= rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array.


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