BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf::TestValuesArrayIterator< VALUE > Class Template Reference

#include <bsltf_testvaluesarray.h>

Public Types

typedef std::input_iterator_tag iterator_category
 
typedef VALUE value_type
 
typedef ptrdiff_t difference_type
 
typedef const VALUE * pointer
 
typedef const VALUE & reference
 Standard iterator defined types [24.4.2].
 

Public Member Functions

 TestValuesArrayIterator (const VALUE *object, const VALUE *end, bool *dereferenceable, bool *isValid)
 
 TestValuesArrayIterator (const TestValuesArrayIterator &original)
 
TestValuesArrayIteratoroperator= (const TestValuesArrayIterator &other)
 
TestValuesArrayIteratoroperator++ ()
 
TestValuesArray_PostIncrementPtr< VALUE > operator++ (int)
 
const VALUE & operator* () const
 
const VALUE * operator-> () const
 

Friends

template<class OTHER_VALUE >
bool operator== (const TestValuesArrayIterator< OTHER_VALUE > &, const TestValuesArrayIterator< OTHER_VALUE > &)
 
template<class OTHER_VALUE >
bool operator!= (const TestValuesArrayIterator< OTHER_VALUE > &, const TestValuesArrayIterator< OTHER_VALUE > &)
 

Detailed Description

template<class VALUE>
class bsltf::TestValuesArrayIterator< VALUE >

This class provide a STL-conforming input iterator over values used for testing (see section [24.2.3 input.iterators] of the C++11 standard. A TestValuesArrayIterator provide access to elements of parameterized type VALUE. An iterator is considered dereferenceable all of the following are satisfied:

  1. The iterator refers to a valid element (not end).
  2. The iterator has not been dereferenced.
  3. The iterator is not a copy of another iterator of which operator++ have been invoked. An iterator is comparable if the iterator is not a copy of another iterator of which operator++ have been invoked.

This class is not thread-safe: different iterator objects manipulate shared state without synchronization. This is rarely a concern for the test scenarios supported by this component.

See bsltf_testvaluesarray

Member Typedef Documentation

◆ difference_type

template<class VALUE >
typedef ptrdiff_t bsltf::TestValuesArrayIterator< VALUE >::difference_type

◆ iterator_category

template<class VALUE >
typedef std::input_iterator_tag bsltf::TestValuesArrayIterator< VALUE >::iterator_category

◆ pointer

template<class VALUE >
typedef const VALUE* bsltf::TestValuesArrayIterator< VALUE >::pointer

◆ reference

template<class VALUE >
typedef const VALUE& bsltf::TestValuesArrayIterator< VALUE >::reference

◆ value_type

template<class VALUE >
typedef VALUE bsltf::TestValuesArrayIterator< VALUE >::value_type

Constructor & Destructor Documentation

◆ TestValuesArrayIterator() [1/2]

template<class VALUE >
bsltf::TestValuesArrayIterator< VALUE >::TestValuesArrayIterator ( const VALUE *  object,
const VALUE *  end,
bool *  dereferenceable,
bool *  isValid 
)
inline

Create an iterator referring to the specified object for a container with the specified end, with two arrays of boolean referred to by the specified dereferenceable and isValid to indicate whether this iterator and its subsequent values until end is allowed to be dereferenced and is not yet invalidated respectively.

◆ TestValuesArrayIterator() [2/2]

template<class VALUE >
bsltf::TestValuesArrayIterator< VALUE >::TestValuesArrayIterator ( const TestValuesArrayIterator< VALUE > &  original)
inline

Create an iterator having the same value as the specified original object. The behavior is undefined unless original is valid.

Member Function Documentation

◆ operator*()

template<class VALUE >
const VALUE & bsltf::TestValuesArrayIterator< VALUE >::operator* ( ) const
inline

Return the value referred to by this object. This object is no longer dereferenceable after a call to this function. The behavior is undefined unless this iterator is dereferenceable.

◆ operator++() [1/2]

template<class VALUE >
TestValuesArrayIterator< VALUE > & bsltf::TestValuesArrayIterator< VALUE >::operator++ ( )

Move this iterator to the next element in the container. Any copies of this iterator are no longer dereferenceable or comparable. The behavior is undefined unless this iterator refers to a valid value in the container.

◆ operator++() [2/2]

template<class VALUE >
TestValuesArray_PostIncrementPtr< VALUE > bsltf::TestValuesArrayIterator< VALUE >::operator++ ( int  )

Move this iterator to the next element in the container, and return an object that can be dereferenced to refer to the same object that this iterator initially points to. Any copies of this iterator are no longer dereferenceable or comparable. The behavior is undefined unless this iterator refers to a valid value in the container.

◆ operator->()

template<class VALUE >
const VALUE * bsltf::TestValuesArrayIterator< VALUE >::operator-> ( ) const
inline

Return the address of the element (of the template parameter VALUE) at which this iterator is positioned. The behavior is undefined unless this iterator dereferenceable.

◆ operator=()

template<class VALUE >
TestValuesArrayIterator< VALUE > & bsltf::TestValuesArrayIterator< VALUE >::operator= ( const TestValuesArrayIterator< VALUE > &  other)

Assign to this object the value of the specified other object. The behavior is undefined unless other is valid.

Friends And Related Symbol Documentation

◆ operator!=

template<class VALUE >
template<class OTHER_VALUE >
bool operator!= ( const TestValuesArrayIterator< OTHER_VALUE > &  ,
const TestValuesArrayIterator< OTHER_VALUE > &   
)
friend

◆ operator==

template<class VALUE >
template<class OTHER_VALUE >
bool operator== ( const TestValuesArrayIterator< OTHER_VALUE > &  ,
const TestValuesArrayIterator< OTHER_VALUE > &   
)
friend

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