Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Friends

bdlc::PackedIntArrayConstIterator< TYPE > Class Template Reference

#include <bdlc_packedintarray.h>

List of all members.

Public Types

typedef bsl::ptrdiff_t difference_type
typedef bsl::size_t size_type
typedef TYPE value_type
typedef void * pointer
typedef TYPE & reference

Public Member Functions

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

Friends

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

Detailed Description

template<class TYPE>
class bdlc::PackedIntArrayConstIterator< TYPE >

This unconstrained (value-semantic) class represents a random access iterator providing non-modifiable access to the elements of a PackedIntArray. 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. The returned iterator, it, referencing an element within a PackedIntArray, array, remains valid while 0 <= it - array.begin() < array.length().

See Component bdlc_packedintarray


Member Typedef Documentation

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

The type

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

The type

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

The type for

template<class TYPE>
typedef void* bdlc::PackedIntArrayConstIterator< TYPE >::pointer

The type of

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

The type for


Constructor & Destructor Documentation

template<class TYPE>
bdlc::PackedIntArrayConstIterator< TYPE >::PackedIntArrayConstIterator (  ) 

Create a default PackedIntArrayConstIterator. Note that the use of most methods - as indicated in their documentation - upon this iterator will result in undefined behavior.

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

Create a PackedIntArrayConstIterator having the same value as the specified original one.

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

Destroy this object.


Member Function Documentation

template<class TYPE>
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::operator= ( const PackedIntArrayConstIterator< 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>
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::operator++ (  ) 

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

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

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

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

Advance this iterator by the specified offset from the element referenced to this iterator. The returned iterator, it, referencing an element within a PackedIntArray, array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless PackedIntArrayConstInterator() != *this and 0 <= *this - array.begin() + offset <= array.length().

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

Decrement this iterator by the specified offset from the element referenced to this iterator. The returned iterator, it, referencing an element within a PackedIntArray, array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless PackedIntArrayConstInterator() != *this and 0 <= *this - array.begin() - offset <= array.length().

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

Return the element value referenced by this iterator. The behavior is undefined unless for this iterator, referencing an element within a PackedIntArray array, PackedIntArrayConstInterator() != *this and *this - array.begin() < array.length().

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

Return the element value referenced by this iterator. The behavior is undefined unless for this iterator, referencing an element within a PackedIntArray array, PackedIntArrayConstInterator() != *this and *this - array.begin() < array.length().

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

Return the element that is the specified offset from the element reference by this array. The behavior is undefined unless for this iterator, referencing an element within a PackedIntArray array, PackedIntArrayConstInterator() != *this and 0 <= *this - array.begin() + offset < array.length().

template<class TYPE>
PackedIntArrayConstIterator bdlc::PackedIntArrayConstIterator< TYPE >::operator+ ( bsl::ptrdiff_t  offset  )  const

Return an iterator referencing the location at the specified offset from the element referenced by this iterator. The returned iterator, it, referencing an element within a PackedIntArray, array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless 0 <= *this - array.begin() + offset <= array.length().

template<class TYPE>
PackedIntArrayConstIterator bdlc::PackedIntArrayConstIterator< TYPE >::operator- ( bsl::ptrdiff_t  offset  )  const

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


Friends And Related Function Documentation

template<class TYPE>
friend class PackedIntArray< TYPE > [friend]
template<class TYPE>
PackedIntArrayConstIterator operator++ ( PackedIntArrayConstIterator< TYPE > &  ,
int   
) [friend]

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

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

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

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

Return true if the specified lhs and rhs iterators have the same value, and false otherwise. Two PackedIntArrayConstIterator iterators have the same value if they refer to the same array, and have the same index.

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

Return true if the specified lhs and rhs iterators do not have the same value and false otherwise. Two PackedIntArrayConstIterator iterators do not have the same value if they do not refer to the same array, or do not have the same index.

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

Return the number of elements between specified lhs and rhs. The behavior is undefined unless lhs and rhs reference the same array.

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

Return true if the specified lhs has a value less than the specified rhs, false otherwise. An iterator has a value less than another if its index is less the other's index. The behavior is undefined unless lhs and rhs refer to the same array.

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

Return true if the specified lhs has a value less than or equal to the specified rhs, 'false otherwise. An iterator has a value less than or equal to another if its index is less or equal the other's index. The behavior is undefined unless lhs and rhs refer to the same array.

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

Return true if the specified lhs has a value greater than the specified rhs, false otherwise. An iterator has a value greater than another if its index is greater the other's index. The behavior is undefined unless lhs and rhs refer to the same array.

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

Return true if the specified lhs has a value greater or equal than the specified rhs, false otherwise. An iterator has a value greater than or equal to another if its index is greater the other's index. The behavior is undefined unless lhs and rhs refer to the same array.


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