BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL > Class Template Reference

#include <bsltf_testvaluesarray.h>

Detailed Description

template<class VALUE, class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
class bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >

This class provides a container to store values of the (template parameter) type VALUE, and also provides the iterators to access the values. The iterators are designed to conform to a standard input iterator, and report any misuse of the iterator.

See bsltf_testvaluesarray

Public Types

typedef TestValuesArrayIterator< VALUE > iterator
 
typedef TestValuesArraySentinel< VALUE > sentinel
 
typedef TestValuesArrayIterator< const VALUE > const_iterator
 
typedef TestValuesArraySentinel< const VALUE > const_sentinel
 
typedef bsl::conditional< USE_SENTINEL, sentinel, iterator >::type EndReturnType
 
typedef bsl::conditional< USE_SENTINEL, const_sentinel, const_iterator >::type ConstEndReturnType
 

Public Member Functions

sentinel privateEnd (BSLMF_TYPEIDENTITY_T(sentinel))
 
iterator privateEnd (BSLMF_TYPEIDENTITY_T(iterator))
 
const_sentinel privateEnd (BSLMF_TYPEIDENTITY_T(const_sentinel)) const
 
const_iterator privateEnd (BSLMF_TYPEIDENTITY_T(const_iterator)) const
 
 TestValuesArray ()
 
 TestValuesArray (ALLOCATOR basicAllocator)
 
 TestValuesArray (const char *spec)
 
 TestValuesArray (const char *spec, ALLOCATOR basicAllocator)
 
 ~TestValuesArray ()
 
iterator begin ()
 
EndReturnType end ()
 
iterator index (size_t position)
 
void resetIterators ()
 
const_iterator begin () const
 
ConstEndReturnType end () const
 
const VALUE * data () const
 
const VALUE & operator[] (size_t index) const
 
size_t size () const
 

Member Typedef Documentation

◆ const_iterator

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef TestValuesArrayIterator<const VALUE> bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::const_iterator

◆ const_sentinel

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef TestValuesArraySentinel<const VALUE> bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::const_sentinel

◆ ConstEndReturnType

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef bsl::conditional<USE_SENTINEL,const_sentinel,const_iterator>::type bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::ConstEndReturnType

◆ EndReturnType

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef bsl::conditional<USE_SENTINEL,sentinel,iterator>::type bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::EndReturnType

◆ iterator

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef TestValuesArrayIterator< VALUE> bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::iterator

Iterator/Sentinel for this container.

◆ sentinel

template<class VALUE , class ALLOCATOR = bsl::allocator<VALUE>, class CONVERTER = TestValuesArray_DefaultConverter<VALUE, ALLOCATOR>, bool USE_SENTINEL = false>
typedef TestValuesArraySentinel< VALUE> bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::sentinel

Constructor & Destructor Documentation

◆ TestValuesArray() [1/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::TestValuesArray ( )
explicit

Create a TestValuesArray object. Optionally, specify spec to indicate the values this object should contain, where the values are created by invoking the bsltf::TemplateTestFacility::create method on each character of spec. If no spec is supplied, the object will contain 52 distinct values of the (template parameter) type VALUE. Optionally, specify basicAllocator used to supply memory. If no allocator is supplied, a bslma::MallocFree allocator is used to supply memory.

◆ TestValuesArray() [2/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::TestValuesArray ( ALLOCATOR  basicAllocator)
explicit

◆ TestValuesArray() [3/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::TestValuesArray ( const char *  spec)
inlineexplicit

◆ TestValuesArray() [4/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::TestValuesArray ( const char *  spec,
ALLOCATOR  basicAllocator 
)
inlineexplicit

◆ ~TestValuesArray()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::~TestValuesArray ( )

Destroy this container and all contained elements.

Member Function Documentation

◆ begin() [1/2]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::iterator bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::begin ( )
inline

Return an iterator providing non-modifiable access to the first VALUE object in the sequence of VALUE objects maintained by this container, or the end iterator if this container is empty.

◆ begin() [2/2]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::const_iterator bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::begin ( ) const
inline

Return an iterator providing non-modifiable access to the first VALUE object in the sequence of VALUE objects maintained by this container, or the end iterator if this container is empty.

◆ data()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
const VALUE * bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::data ( ) const
inline

Return the address of the non-modifiable first element in this container.

◆ end() [1/2]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::EndReturnType bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::end ( )
inline

Return an iterator (sentinel) referencing to one position past the end of the sequence of VALUE objects maintained by this container. The return type is determined by (template) parameter USE_SENTINEL and USE_SENTINEL defaults to false(i.e.,end()returns an iterator`).

◆ end() [2/2]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::ConstEndReturnType bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::end ( ) const
inline

Return an iterator providing non-modifiable access to the past-the-end position in the sequence of VALUE objects maintained by this container.

◆ index()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::iterator bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::index ( size_t  position)
inline

Return an iterator to the element at the specified position.

Precondition
The behavior is undefined unless position <= size().

◆ operator[]()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
const VALUE & bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::operator[] ( size_t  index) const
inline

Return a reference providing non-modifiable access to the element at the specified index.

Precondition
The behavior is undefined unless 0 < size() && index < size().

◆ privateEnd() [1/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::const_iterator bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::privateEnd ( BSLMF_TYPEIDENTITY_T(const_iterator ) const
inline

◆ privateEnd() [2/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::const_sentinel bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::privateEnd ( BSLMF_TYPEIDENTITY_T(const_sentinel ) const
inline

◆ privateEnd() [3/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::iterator bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::privateEnd ( BSLMF_TYPEIDENTITY_T(iterator )
inline

◆ privateEnd() [4/4]

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::sentinel bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::privateEnd ( BSLMF_TYPEIDENTITY_T(sentinel )
inline

◆ resetIterators()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
void bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::resetIterators ( )

Make all iterators dereferenceable and comparable again.

◆ size()

template<class VALUE , class ALLOCATOR , class CONVERTER , bool USE_SENTINEL>
size_t bsltf::TestValuesArray< VALUE, ALLOCATOR, CONVERTER, USE_SENTINEL >::size ( ) const
inline

Return number of elements in this container.


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