BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdld::DatumMaker Class Reference

#include <bdld_datummaker.h>

Public Types

typedef bsl::allocator AllocatorType
 

Public Member Functions

 DatumMaker (const AllocatorType &allocator)
 
bslma::Allocatorallocator () const
 
AllocatorType get_allocator () const
 
bdld::Datum operator() () const
 Return a bdld::Datum having a null value.
 
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
 
bdld::Datum bin (const void *pointer, bsl::size_t size) 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 bdld_datummaker

Member Typedef Documentation

◆ AllocatorType

Constructor & Destructor Documentation

◆ DatumMaker()

bdld::DatumMaker::DatumMaker ( const AllocatorType allocator)
inlineexplicit

Create a new DatumMaker object that uses the specified allocator (e.g., the address of a bslma::Allocator object) to supply memory for the created bdld::Datum objects.

Member Function Documentation

◆ a()

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

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

◆ allocator()

bslma::Allocator * bdld::DatumMaker::allocator ( ) const
inline
Deprecated:
Use get_allocator() instead.

Return get_allocator().mechanism().

◆ bin()

bdld::Datum bdld::DatumMaker::bin ( const void *  pointer,
bsl::size_t  size 
) const
inline

Return a binary bdld::Datum having a value that is the copy of the memory area described by the specified pointer and size.

◆ get_allocator()

DatumMaker::AllocatorType bdld::DatumMaker::get_allocator ( ) const
inline

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.

◆ im()

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

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.

◆ m()

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

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.

◆ mok()

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

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.

◆ operator()() [1/23]

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

◆ operator()() [2/23]

bdld::Datum bdld::DatumMaker::operator() ( bdldfp::Decimal64  value) const
inline

◆ operator()() [3/23]

bdld::Datum bdld::DatumMaker::operator() ( bool  value) const
inline

◆ operator()() [4/23]

bdld::Datum bdld::DatumMaker::operator() ( bsls::Types::Int64  value) const
inline

◆ operator()() [5/23]

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

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

◆ operator()() [6/23]

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

◆ operator()() [7/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::Datum elements,
int  size 
) const
inline

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.

◆ operator()() [8/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumArrayRef value) const
inline

◆ operator()() [9/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumError value) const
inline

◆ operator()() [10/23]

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

◆ operator()() [11/23]

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

◆ operator()() [12/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumMutableIntMapRef value) const
inline

◆ operator()() [13/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumMutableMapRef value) const
inline

◆ operator()() [14/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdld::DatumUdt value) const
inline

◆ operator()() [15/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Date value) const
inline

◆ operator()() [16/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Datetime value) const
inline

◆ operator()() [17/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdlt::DatetimeInterval value) const
inline

◆ operator()() [18/23]

bdld::Datum bdld::DatumMaker::operator() ( const bdlt::Time value) const
inline

◆ operator()() [19/23]

bdld::Datum bdld::DatumMaker::operator() ( const bslmf::Nil value) const
inline

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.

◆ operator()() [20/23]

bdld::Datum bdld::DatumMaker::operator() ( const bslstl::StringRef value) const
inline

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

◆ operator()() [21/23]

bdld::Datum bdld::DatumMaker::operator() ( const char *  value) const
inline

◆ operator()() [22/23]

bdld::Datum bdld::DatumMaker::operator() ( double  value) const
inline

◆ operator()() [23/23]

bdld::Datum bdld::DatumMaker::operator() ( int  value) const
inline

◆ ref()

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

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: