Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bdld::DatumMaker Class Reference

#include <bdld_datummaker.h>

List of all members.

Public Member Functions

 DatumMaker (bslma::Allocator *basicAllocator)
bslma::Allocatorallocator () const
bdld::Datum operator() () const
bdld::Datum operator() (const bslmf::Nil &value) const
bdld::Datum operator() (int value) const
bdld::Datum operator() (double value) const
bdld::Datum operator() (bool value) const
bdld::Datum operator() (const bdld::DatumError &value) const
bdld::Datum operator() (const bdlt::Date &value) const
bdld::Datum operator() (const bdlt::Time &value) const
bdld::Datum operator() (const bdlt::Datetime &value) const
bdld::Datum operator() (const bdlt::DatetimeInterval &value) const
bdld::Datum operator() (bdldfp::Decimal64 value) const
bdld::Datum operator() (bsls::Types::Int64 value) const
bdld::Datum operator() (const bdld::DatumUdt &value) const
bdld::Datum operator() (const bdld::Datum &value) const
bdld::Datum operator() (const bdld::DatumArrayRef &value) const
bdld::Datum operator() (const bdld::DatumMutableMapRef &value) const
bdld::Datum operator() (const bdld::DatumMutableIntMapRef &value) const
bdld::Datum operator() (const bdld::Datum *elements, int size) const
bdld::Datum operator() (const bdld::DatumMapEntry *elements, int size, bool sorted=false) const
bdld::Datum operator() (const bdld::DatumIntMapEntry *elements, int size, bool sorted=false) const
bdld::Datum operator() (const bslstl::StringRef &value) const
bdld::Datum operator() (const char *value) const
template<class TYPE >
bdld::Datum operator() (const bdlb::NullableValue< TYPE > &value) const
template<typename... ELEMENTS>
bdld::Datum a (const ELEMENTS &...elements) const
template<typename... ENTRIES>
bdld::Datum m (const ENTRIES &...entries) const
template<typename... ENTRIES>
bdld::Datum mok (const ENTRIES &...entries) const
template<typename... ENTRIES>
bdld::Datum im (const ENTRIES &...entries) const
bdld::Datum ref (const bslstl::StringRef &string) const

Detailed Description

This concrete mechanism class provides "sugar" for easily creating bdld::Datum objects for testing.

See Component bdld_datummaker


Constructor & Destructor Documentation

bdld::DatumMaker::DatumMaker ( bslma::Allocator basicAllocator  )  [explicit]

Create a new DatumMaker object using the specified basicAllocator to supply memory for created bdld::Datum objects.


Member Function Documentation

bslma::Allocator* bdld::DatumMaker::allocator (  )  const

Return the allocator used by this object (the one supplied at construction time.

bdld::Datum bdld::DatumMaker::operator() (  )  const

Return a bdld::Datum having a null value.

bdld::Datum bdld::DatumMaker::operator() ( const bslmf::Nil value  )  const
bdld::Datum bdld::DatumMaker::operator() ( int  value  )  const
bdld::Datum bdld::DatumMaker::operator() ( double  value  )  const
bdld::Datum bdld::DatumMaker::operator() ( bool  value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumError value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Date value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Time value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Datetime value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdlt::DatetimeInterval value  )  const
bdld::Datum bdld::DatumMaker::operator() ( bdldfp::Decimal64  value  )  const
bdld::Datum bdld::DatumMaker::operator() ( bsls::Types::Int64  value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumUdt value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::Datum value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumArrayRef value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumMutableMapRef value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumMutableIntMapRef value  )  const

Return a bdld::Datum having the specified value. Note that where possible, no memory is allocated - array are returned as references. Note that DatumMapRef and DatumIntMapRef are not supported at the moment.

bdld::Datum bdld::DatumMaker::operator() ( const bdld::Datum elements,
int  size 
) const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumMapEntry elements,
int  size,
bool  sorted = false 
) const
bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumIntMapEntry elements,
int  size,
bool  sorted = false 
) const

Return a bdld::Datum having the specified size number of elements. Note that where possible, no memory is allocated - arrays are returned as references. Note that DatumMapRef and DatumIntMapRef are not supported at the moment.

bdld::Datum bdld::DatumMaker::operator() ( const bslstl::StringRef value  )  const
bdld::Datum bdld::DatumMaker::operator() ( const char *  value  )  const

Return a bdld::Datum having the specified value. The returned bdld::Datum object will contain a deep-copy of value.

template<class TYPE >
bdld::Datum bdld::DatumMaker::operator() ( const bdlb::NullableValue< TYPE > &  value  )  const

Return a bdld::Datum having the specified value, or null if value is unset.

template<typename... ELEMENTS>
bdld::Datum bdld::DatumMaker::a ( const ELEMENTS &...  elements  )  const

Return a bdld::Datum having an array value of the specified elements.

template<typename... ENTRIES>
bdld::Datum bdld::DatumMaker::m ( const ENTRIES &...  entries  )  const

Return a bdld::Datum object containing a map of the specified entries. The entries are supplied as pairs (odd number of sizeof...(entries) being an error) where the first specified element is the key, and the second is its corresponding value. The behavior is undefined if the same key is supplied more than once.

template<typename... ENTRIES>
bdld::Datum bdld::DatumMaker::mok ( const ENTRIES &...  entries  )  const

Return a bdld::Datum object containing a map with owned keys consisting of the specified entries. The entries are supplied as pairs (odd number of sizeof...(entries) being an error) where the first specified element is the key, and the second is its corresponding value. The behavior is undefined if the same key is supplied more than once.

template<typename... ENTRIES>
bdld::Datum bdld::DatumMaker::im ( const ENTRIES &...  entries  )  const

Return a bdld::Datum object containing an integer-map of the specified entries. The entries are supplied in pairs (supplying an odd number will result in a compilation failure) where the first supplied argument is an integer key, and the second is its corresponding value. The behavior is undefined if the same key is supplied more than once.

bdld::Datum bdld::DatumMaker::ref ( const bslstl::StringRef string  )  const

Return a bdld::Datum object that references, but does not own the specified string, possibly using the allocator of this object to obtain memory. Note that this can be used to refer to string literals. See bdld::Datum::createStringRef().


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