BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlc::PackedIntArrayConstIterator< TYPE > Class Template Reference

#include <bdlc_packedintarray.h>

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 ()=default
 
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 bdlc_packedintarray

Member Typedef Documentation

◆ difference_type

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

◆ pointer

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

◆ reference

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

◆ size_type

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

◆ value_type

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

Constructor & Destructor Documentation

◆ PackedIntArrayConstIterator() [1/2]

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

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

◆ PackedIntArrayConstIterator() [2/2]

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

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

◆ ~PackedIntArrayConstIterator()

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

Member Function Documentation

◆ operator*()

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

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().

◆ operator+()

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

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().

◆ operator++()

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

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().

◆ operator+=()

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

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().

◆ operator-()

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

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().

◆ operator--()

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

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().

◆ operator-=()

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

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().

◆ operator->()

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

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().

◆ operator=()

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

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

◆ operator[]()

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

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().

Friends And Related Symbol Documentation

◆ operator!=

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.

◆ operator++

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().

◆ operator-

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.

◆ operator--

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().

◆ operator<

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.

◆ operator<=

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.

◆ operator==

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.

◆ operator>

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.

◆ operator>=

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.

◆ PackedIntArray< TYPE >

template<class TYPE >
friend class PackedIntArray< TYPE >
friend

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