Quick Links:

bal | bbl | bdl | bsl

Public Types | Static Public Member Functions

bslalg::ArrayPrimitives_Imp Struct Reference

#include <bslalg_arrayprimitives.h>

List of all members.

Public Types

enum  {
  e_IS_ITERATOR_TO_FUNCTION_POINTER = 6, e_IS_POINTER_TO_POINTER = 5, e_IS_FUNDAMENTAL_OR_POINTER = 4, e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS = 3,
  e_BITWISE_COPYABLE_TRAITS = 2, e_BITWISE_MOVEABLE_TRAITS = 1, e_NIL_TRAITS = 0
}
enum  { k_INPLACE_BUFFER_SIZE = 16 * bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT }
typedef ArrayPrimitives::size_type size_type
typedef
ArrayPrimitives::difference_type 
difference_type

Static Public Member Functions

static void bitwiseFillN (char *begin, size_type numBytesInitialized, size_type numBytes)
static void uninitializedFillN (bool *begin, bool value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (char *begin, char value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (unsigned char *begin, unsigned char value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (signed char *begin, signed char value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (wchar_t *begin, wchar_t value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (short *begin, short value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (unsigned short *begin, unsigned short value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (int *begin, int value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (unsigned int *begin, unsigned int value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (long *begin, long value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (unsigned long *begin, unsigned long value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (bsls::Types::Int64 *begin, bsls::Types::Int64 value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (bsls::Types::Uint64 *begin, bsls::Types::Uint64 value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (float *begin, float value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (double *begin, double value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (long double *begin, long double value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (void **begin, void *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (const void **begin, const void *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (volatile void **begin, volatile void *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
static void uninitializedFillN (const volatile void **begin, const volatile void *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
template<class TARGET_TYPE >
static void uninitializedFillN (TARGET_TYPE **begin, TARGET_TYPE *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
template<class TARGET_TYPE >
static void uninitializedFillN (const TARGET_TYPE **begin, const TARGET_TYPE *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
template<class TARGET_TYPE >
static void uninitializedFillN (volatile TARGET_TYPE **begin, volatile TARGET_TYPE *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
template<class TARGET_TYPE >
static void uninitializedFillN (const volatile TARGET_TYPE **begin, const volatile TARGET_TYPE *value, size_type numElements, void *=0, bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *=0)
template<class TARGET_TYPE , class ALLOCATOR >
static void uninitializedFillN (TARGET_TYPE *begin, const TARGET_TYPE &value, size_type numElements, ALLOCATOR *allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void uninitializedFillN (TARGET_TYPE *begin, const TARGET_TYPE &value, size_type numElements, ALLOCATOR *allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void copyConstruct (TARGET_TYPE *toBegin, FWD_ITER fromBegin, FWD_ITER fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_IS_POINTER_TO_POINTER > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void copyConstruct (TARGET_TYPE *toBegin, const TARGET_TYPE *fromBegin, const TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void copyConstruct (TARGET_TYPE *toBegin, FWD_ITER fromBegin, FWD_ITER fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *)
template<class FWD_ITER , class ALLOCATOR >
static void copyConstruct (void **toBegin, FWD_ITER fromBegin, FWD_ITER fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void copyConstruct (TARGET_TYPE *toBegin, FWD_ITER fromBegin, FWD_ITER fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void moveConstruct (TARGET_TYPE *toBegin, TARGET_TYPE *fromBegin, TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void moveConstruct (TARGET_TYPE *toBegin, TARGET_TYPE *fromBegin, TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void moveIfNoexcept (TARGET_TYPE *toBegin, TARGET_TYPE *fromBegin, TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void defaultConstruct (TARGET_TYPE *begin, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void defaultConstruct (TARGET_TYPE *begin, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void defaultConstruct (TARGET_TYPE *begin, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void destructiveMove (TARGET_TYPE *toBegin, TARGET_TYPE *fromBegin, TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void destructiveMove (TARGET_TYPE *toBegin, TARGET_TYPE *fromBegin, TARGET_TYPE *fromEnd, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void emplace (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *, ARGS &&...args)
template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void emplace (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *, ARGS &&...args)
template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void emplace (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *, ARGS &&...args)
template<class TARGET_TYPE , class ALLOCATOR >
static void erase (TARGET_TYPE *first, TARGET_TYPE *middle, TARGET_TYPE *last, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void erase (TARGET_TYPE *first, TARGET_TYPE *middle, TARGET_TYPE *last, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, const TARGET_TYPE &value, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, const TARGET_TYPE &value, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, const TARGET_TYPE &value, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, FWD_ITER fromBegin, FWD_ITER fromEnd, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_IS_POINTER_TO_POINTER > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, const TARGET_TYPE *fromBegin, const TARGET_TYPE *fromEnd, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, FWD_ITER fromBegin, FWD_ITER fromEnd, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class FWD_ITER , class ALLOCATOR >
static void insert (void **toBegin, void **toEnd, FWD_ITER fromBegin, FWD_ITER fromEnd, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *)
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void insert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, FWD_ITER fromBegin, FWD_ITER fromEnd, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void moveInsert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, TARGET_TYPE **lastPtr, TARGET_TYPE *first, TARGET_TYPE *last, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class TARGET_TYPE , class ALLOCATOR >
static void moveInsert (TARGET_TYPE *toBegin, TARGET_TYPE *toEnd, TARGET_TYPE **lastPtr, TARGET_TYPE *first, TARGET_TYPE *last, size_type numElements, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class TARGET_TYPE >
static void rotate (TARGET_TYPE *begin, TARGET_TYPE *middle, TARGET_TYPE *end, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class TARGET_TYPE >
static void rotate (TARGET_TYPE *begin, TARGET_TYPE *middle, TARGET_TYPE *end, bslmf::MetaInt< e_NIL_TRAITS > *)
template<class ALLOCATOR >
static void shiftAndInsert (typename bsl::allocator_traits< ALLOCATOR >::pointer begin, typename bsl::allocator_traits< ALLOCATOR >::pointer end, bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type > value, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *)
template<class ALLOCATOR >
static void shiftAndInsert (typename bsl::allocator_traits< ALLOCATOR >::pointer begin, typename bsl::allocator_traits< ALLOCATOR >::pointer end, bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type > value, ALLOCATOR allocator, bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *)
template<class ALLOCATOR >
static void shiftAndInsert (typename bsl::allocator_traits< ALLOCATOR >::pointer begin, typename bsl::allocator_traits< ALLOCATOR >::pointer end, bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type > value, ALLOCATOR allocator, bslmf::MetaInt< e_NIL_TRAITS > *)
static void bitwiseRotate (char *begin, char *middle, char *end)
static void bitwiseRotateBackward (char *begin, char *middle, char *end)
static void bitwiseRotateForward (char *begin, char *middle, char *end)
static void bitwiseSwapRanges (char *begin, char *middle, char *end)
template<class FORWARD_ITERATOR >
static bool isInvalidRange (FORWARD_ITERATOR begin, FORWARD_ITERATOR end)
template<class TARGET_TYPE >
static bool isInvalidRange (TARGET_TYPE *begin, TARGET_TYPE *end)

Detailed Description

This struct provides a namespace for a suite of independent utility functions that operate on arrays of elements of a parameterized TARGET_TYPE. These utility functions are only for the purpose of implementing those in the ArrayPrimitives utility. For brevity, we do not repeat the main contracts here, but instead refer to the corresponding contract in the ArrayPrimitives utility.

See Component bslalg_arrayprimitives


Member Typedef Documentation


Member Enumeration Documentation

anonymous enum

These constants are used in the overloads below, when the last argument is of type bslmf::MetaInt<N> *, indicating that TARGET_TYPE has the traits for which the enumerator equal to N is named.

Enumerator:
e_IS_ITERATOR_TO_FUNCTION_POINTER 
e_IS_POINTER_TO_POINTER 
e_IS_FUNDAMENTAL_OR_POINTER 
e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS 
e_BITWISE_COPYABLE_TRAITS 
e_BITWISE_MOVEABLE_TRAITS 
e_NIL_TRAITS 
anonymous enum

Number of bytes for which a stack-allocated buffer can be comfortably obtained to optimize bitwise moves.

Enumerator:
k_INPLACE_BUFFER_SIZE 

Member Function Documentation

static void bslalg::ArrayPrimitives_Imp::bitwiseFillN ( char *  begin,
size_type  numBytesInitialized,
size_type  numBytes 
) [static]

Fill the specified numBytes in the array starting at the specified begin address, as if by bit-wise copying the specified numBytesInitialized at every offset that is a multiple of numBytesInitialized within the output array. The behavior is undefined unless numBytesInitialized <= numBytes. Note that numBytes usually is, but does not have to be, a multiple of numBytesInitialized.

static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( bool *  begin,
bool  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( char *  begin,
char  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( unsigned char *  begin,
unsigned char  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( signed char *  begin,
signed char  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( wchar_t *  begin,
wchar_t  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( short *  begin,
short  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( unsigned short *  begin,
unsigned short  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( int *  begin,
int  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( unsigned int *  begin,
unsigned int  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( long *  begin,
long  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( unsigned long *  begin,
unsigned long  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( bsls::Types::Int64 begin,
bsls::Types::Int64  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( bsls::Types::Uint64 begin,
bsls::Types::Uint64  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( float *  begin,
float  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( double *  begin,
double  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( long double *  begin,
long double  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( void **  begin,
void *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( const void **  begin,
const void *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( volatile void **  begin,
volatile void *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( const volatile void **  begin,
const volatile void *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( TARGET_TYPE **  begin,
TARGET_TYPE *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( const TARGET_TYPE **  begin,
const TARGET_TYPE *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( volatile TARGET_TYPE **  begin,
volatile TARGET_TYPE *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( const volatile TARGET_TYPE **  begin,
const volatile TARGET_TYPE *  value,
size_type  numElements,
void *  = 0,
bslmf::MetaInt< e_IS_FUNDAMENTAL_OR_POINTER > *  = 0 
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( TARGET_TYPE *  begin,
const TARGET_TYPE &  value,
size_type  numElements,
ALLOCATOR *  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::uninitializedFillN ( TARGET_TYPE *  begin,
const TARGET_TYPE &  value,
size_type  numElements,
ALLOCATOR *  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

Copy the specified value of the parameterized TARGET_TYPE into every of the specified numElements in the array starting at the specified begin address. Pass the specified allocator to the copy constructor if appropriate. Note that if TARGET_TYPE is bit-wise copyable or is not based on bslma::Allocator, allocator is ignored. The last argument is for removing overload ambiguities and is not used.

template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::copyConstruct ( TARGET_TYPE *  toBegin,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_IS_POINTER_TO_POINTER > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::copyConstruct ( TARGET_TYPE *  toBegin,
const TARGET_TYPE *  fromBegin,
const TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::copyConstruct ( TARGET_TYPE *  toBegin,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *   
) [static]
template<class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::copyConstruct ( void **  toBegin,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *   
) [static]
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::copyConstruct ( TARGET_TYPE *  toBegin,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the copyConstruct contract. If the (template parameter) ALLOCATOR type is based on bslma::Allocator and the TARGET_TYPE constructors take an allocator argument, then pass the specified allocator to the copy constructor. The behavior is undefined unless the output array has length at least the distance from the specified fromBegin to the specified fromEnd. Note that if FWD_ITER is the TARGET_TYPE * pointer type and TARGET_TYPE is bit-wise copyable, then this operation is simply memcpy. The last argument is for removing overload ambiguities and is not used.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::moveConstruct ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  fromBegin,
TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::moveConstruct ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  fromBegin,
TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

TBD: improve comment Move-insert into an uninitialized array beginning at the specified toBegin pointer, elements of type given by the allocator_traits class template for (template parameter) ALLOCATOR from elements starting at the specified fromBegin pointer and ending immediately before the specified fromEnd pointer. The elements in the range [fromBegin...fromEnd) are left in a valid but unspecified state. If a constructor throws an exception during the operation, then the destructor is called on any newly-constructed elements, leaving the output array in an uninitialized state. The behavior is undefined unless toBegin refers to space sufficient to hold fromEnd - fromBegin elements.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::moveIfNoexcept ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  fromBegin,
TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

TBD: improve comment Either move- or copy-insert into an uninitialized array beginning at the specified toBegin pointer, elements of type given by the allocator_traits class template for (template parameter) ALLOCATOR from elements starting at the specified fromBegin pointer and ending immediately before the specified fromEnd pointer. The elements in the range [fromBegin...fromEnd) are left in a valid but unspecified state. Use the move constructor if it is guaranteed to not throw or if the target type does not define a copy constructor; otherwise use the copy constructor. If a constructor throws an exception during the operation, then the destructor is called on any newly-constructed elements, leaving the output array in an uninitialized state. The behavior is undefined unless toBegin refers to space sufficient to hold fromEnd - fromBegin elements.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::defaultConstruct ( TARGET_TYPE *  begin,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_HAS_TRIVIAL_DEFAULT_CTOR_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::defaultConstruct ( TARGET_TYPE *  begin,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::defaultConstruct ( TARGET_TYPE *  begin,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

Use the default constructor of the (template parameter) TARGET_TYPE (or memset to 0 if TARGET_TYPE has a trivial default constructor) on each element of the array starting at the specified begin address and ending immediately before the end address. Pass the specified allocator to the default constructor if appropriate. The last argument is for traits overloading resolution only and its value is ignored.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::destructiveMove ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  fromBegin,
TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::destructiveMove ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  fromBegin,
TARGET_TYPE *  fromEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the destructiveMove contract. Note that both arrays cannot overlap (one contains only initialized elements and the other only uninitialized elements), and that if TARGET_TYPE is bit-wise moveable, then this operation is simply memcpy. The last argument is for removing overload ambiguities and is not used.

template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void bslalg::ArrayPrimitives_Imp::emplace ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *  ,
ARGS &&...  args 
) [static]
template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void bslalg::ArrayPrimitives_Imp::emplace ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *  ,
ARGS &&...  args 
) [static]
template<class TARGET_TYPE , class ALLOCATOR , class... ARGS>
static void bslalg::ArrayPrimitives_Imp::emplace ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *  ,
ARGS &&...  args 
) [static]

TBD: document this

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::erase ( TARGET_TYPE *  first,
TARGET_TYPE *  middle,
TARGET_TYPE *  last,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::erase ( TARGET_TYPE *  first,
TARGET_TYPE *  middle,
TARGET_TYPE *  last,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the erase contract. Note that if (template parameter) TARGET_TYPE is bit-wise moveable, then this operation can be implemented by first bit-wise moving the elements in [middle, last) towards first, and destroying [ last - (middle - first), last); note that this cannot throw exceptions.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
const TARGET_TYPE &  value,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
const TARGET_TYPE &  value,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
const TARGET_TYPE &  value,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the insert contract. Note that if TARGET_TYPE is bit-wise copyable, then this operation is simply memmove followed by bitwiseFillN. If TARGET_TYPE is bit-wise moveable, then this operation can still be optimized using memmove followed by repeated assignments, but a guard needs to be set up. The last argument is for removing overload ambiguities and is not used.

template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_IS_POINTER_TO_POINTER > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
const TARGET_TYPE *  fromBegin,
const TARGET_TYPE *  fromEnd,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( void **  toBegin,
void **  toEnd,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_IS_ITERATOR_TO_FUNCTION_POINTER > *   
) [static]
template<class TARGET_TYPE , class FWD_ITER , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::insert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
FWD_ITER  fromBegin,
FWD_ITER  fromEnd,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the insert contract. Note that if TARGET_TYPE is bit-wise copyable and FWD_ITER is convertible to const TARGET_TYPE *, then this operation is simply memmove followed by memcpy. If TARGET_TYPE is bit-wise moveable and FWD_ITER is convertible to const TARGET_TYPE *, then this operation can still be optimized using memmove followed by repeated copies. The last argument is for removing overload ambiguities and is not used.

template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::moveInsert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
TARGET_TYPE **  lastPtr,
TARGET_TYPE *  first,
TARGET_TYPE *  last,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE , class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::moveInsert ( TARGET_TYPE *  toBegin,
TARGET_TYPE *  toEnd,
TARGET_TYPE **  lastPtr,
TARGET_TYPE *  first,
TARGET_TYPE *  last,
size_type  numElements,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the moveInsert contract. Note that if TARGET_TYPE is at least bit-wise moveable, then this operation is simply memmove followed by memcpy.

template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::rotate ( TARGET_TYPE *  begin,
TARGET_TYPE *  middle,
TARGET_TYPE *  end,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class TARGET_TYPE >
static void bslalg::ArrayPrimitives_Imp::rotate ( TARGET_TYPE *  begin,
TARGET_TYPE *  middle,
TARGET_TYPE *  end,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

These functions follow the rotate contract, but the first overload is optimized when the parameterized TARGET_TYPE is bit-wise moveable. The last argument is for removing overload ambiguities and is not used. Note that if TARGET_TYPE is bit-wise moveable, the rotate(char*, char*, char*) can be used, enabling to take the whole implementation out-of-line.

template<class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::shiftAndInsert ( typename bsl::allocator_traits< ALLOCATOR >::pointer  begin,
typename bsl::allocator_traits< ALLOCATOR >::pointer  end,
bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type >  value,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_COPYABLE_TRAITS > *   
) [static]
template<class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::shiftAndInsert ( typename bsl::allocator_traits< ALLOCATOR >::pointer  begin,
typename bsl::allocator_traits< ALLOCATOR >::pointer  end,
bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type >  value,
ALLOCATOR  allocator,
bslmf::MetaInt< e_BITWISE_MOVEABLE_TRAITS > *   
) [static]
template<class ALLOCATOR >
static void bslalg::ArrayPrimitives_Imp::shiftAndInsert ( typename bsl::allocator_traits< ALLOCATOR >::pointer  begin,
typename bsl::allocator_traits< ALLOCATOR >::pointer  end,
bslmf::MovableRef< typename bsl::allocator_traits< ALLOCATOR >::value_type >  value,
ALLOCATOR  allocator,
bslmf::MetaInt< e_NIL_TRAITS > *   
) [static]

Shift the specified [begin, end) sequence one position right, then insert the specified value at the position pointed by begin. The specified allocator is used for the element construction. The behavior is undefined unless the specified [begin, end) sequence contains at least one element.

static void bslalg::ArrayPrimitives_Imp::bitwiseRotate ( char *  begin,
char *  middle,
char *  end 
) [static]

This function follows the rotate contract, but by using bit-wise moves on the underlying char array.

static void bslalg::ArrayPrimitives_Imp::bitwiseRotateBackward ( char *  begin,
char *  middle,
char *  end 
) [static]

Move the characters in the array starting at the specified first address and ending immediately before the specified middle address to the array of the same length ending at the specified last address (and thus starting at the last - (middle - first) address), and move the elements previously in the array starting at middle and ending at last down to the first address. The behavior is undefined unless middle - begin <= k_INPLACE_BUFFER_SIZE.

static void bslalg::ArrayPrimitives_Imp::bitwiseRotateForward ( char *  begin,
char *  middle,
char *  end 
) [static]

Move the characters in the array starting at the specified first address and ending immediately before the specified middle address to the array of the same length ending at the specified last address (and thus starting at the last - (middle - first) address), and move the elements previously in the array starting at middle and ending at last down to the first address. The behavior is undefined unless end - middle <= k_INPLACE_BUFFER_SIZE.

static void bslalg::ArrayPrimitives_Imp::bitwiseSwapRanges ( char *  begin,
char *  middle,
char *  end 
) [static]

Swap the characters in the array starting at the specified first address and ending immediately before the specified middle address with the array of the same length starting at the middle address and ending at the specified last address. The behavior is undefined unless middle - begin == end - middle.

template<class FORWARD_ITERATOR >
static bool bslalg::ArrayPrimitives_Imp::isInvalidRange ( FORWARD_ITERATOR  begin,
FORWARD_ITERATOR  end 
) [static]
template<class TARGET_TYPE >
static bool bslalg::ArrayPrimitives_Imp::isInvalidRange ( TARGET_TYPE *  begin,
TARGET_TYPE *  end 
) [static]

Return true if the specified begin and the specified end provably do not form a valid semi-open range, [begin, end), and false otherwise. Note that begin == null == end produces a valid range, and any other use of the null pointer value will return true. Also note that this function is intended to support testing, primarily through assertions, so will return false unless it can prove that the passed range is invalid. Currently, this function can prove invalid ranges only for pointers, although should also encompass generic random access iterators in a future update, where iterator tag types are levelized below bslalg.


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