CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
OdMemoryAllocator< T > Class Template Reference

#include <OdArray.h>

Inheritance diagram for OdMemoryAllocator< T >:
OdClrMemAllocator< T >

Public Types

typedef unsigned int size_type
 

Static Public Member Functions

static void copyAssignRangeDisjoint (T *pDestination, const T *pSource, size_type numElements)
 
static void copyAssignRange (T *pDestination, const T *pSource, size_type numElements)
 
static void moveAssignRange (T *pDestination, T *pSource, size_type numElements)
 
static void defaultConstruct (T *pElement)
 
static void copyConstruct (T *pElement, const T &value)
 
static void moveConstruct (T *pElement, T &&value)
 
static void copyConstructFill (T *pDestination, size_type numElements, const T &value)
 
static void copyConstructRange (T *pDestination, const T *pSource, size_type numElements)
 
static void moveConstructRange (T *pDestination, T *pSource, size_type numElements)
 
static void defaultConstructFill (T *pDestination, size_type numElements)
 
static void destroy (T *pObject)
 
static void destroyRange (T *objects, size_type numObjects)
 
static bool useRealloc ()
 

Detailed Description

template<class T>
class OdMemoryAllocator< T >

This template class implements memory allocation functions within the ODA Platform.

See also
TD_Db

<group Other_Classes>

Definition at line 87 of file OdArray.h.

Member Typedef Documentation

◆ size_type

template<class T >
typedef unsigned int OdMemoryAllocator< T >::size_type

Definition at line 90 of file OdArray.h.

Member Function Documentation

◆ copyAssignRange()

template<class T >
static void OdMemoryAllocator< T >::copyAssignRange ( T *  pDestination,
const T *  pSource,
size_type  numElements 
)
inlinestatic

This function performs a copy assignment from a source range to a destination range (ranges may overlap).

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.
Remarks
If the source and destination regions overlap, the method copies the overlapping region before it is overwritten. Use copyAssignRangeDisjoint() to handle non-overlapping regions.

Definition at line 127 of file OdArray.h.

◆ copyAssignRangeDisjoint()

template<class T >
static void OdMemoryAllocator< T >::copyAssignRangeDisjoint ( T *  pDestination,
const T *  pSource,
size_type  numElements 
)
inlinestatic

This function performs a copy assignment from a source range to a destination range (ranges must not overlap).

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.
Remarks
If the source and destination regions overlap, the behavior of the function is undefined. Use copyAssignRange() to handle overlapping regions.

Definition at line 103 of file OdArray.h.

◆ copyConstruct()

template<class T >
static void OdMemoryAllocator< T >::copyConstruct ( T *  pElement,
const T &  value 
)
inlinestatic

This function performs a copy constructor on one memory location.

Parameters
pElement[out] Receives the element.
value[in] Value for the element.

Definition at line 187 of file OdArray.h.

◆ copyConstructFill()

template<class T >
static void OdMemoryAllocator< T >::copyConstructFill ( T *  pDestination,
size_type  numElements,
const T &  value 
)
inlinestatic

This function performs a copy constructor on a destination range, copying the same source element.

Parameters
pDestination[in] Pointer to the destination.
numElements[in] Number of elements.
value[in] Value for the elements.

Definition at line 235 of file OdArray.h.

◆ copyConstructRange()

template<class T >
static void OdMemoryAllocator< T >::copyConstructRange ( T *  pDestination,
const T *  pSource,
size_type  numElements 
)
inlinestatic

This function performs a copy constructor from a source range to a destination range.

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.

Definition at line 259 of file OdArray.h.

◆ defaultConstruct()

template<class T >
static void OdMemoryAllocator< T >::defaultConstruct ( T *  pElement)
inlinestatic

This function performs a default constructor on one memory location.

Parameters
pElement[out] Receives the element.
Remarks
In some memory allocators, the method performs value initialization instead of default initialization, i.e., primitive types are zero-initialized instead of being left with undefined values.

Definition at line 172 of file OdArray.h.

◆ defaultConstructFill()

template<class T >
static void OdMemoryAllocator< T >::defaultConstructFill ( T *  pDestination,
size_type  numElements 
)
inlinestatic

This function performs a default constructor on a destination range.

Parameters
pDestination[in] Pointer to the destination.
numElements[in] Number of elements.
Remarks
In some memory allocators, the method performs a value initialization instead of default initialization, i.e., primitive types are zero-initialized instead of being left with undefined values.

Definition at line 292 of file OdArray.h.

◆ destroy()

template<class T >
static void OdMemoryAllocator< T >::destroy ( T *  pObject)
inlinestatic

Calls a destructor for an element at one location.

Parameters
pObject[in] Pointer to the object.

Definition at line 304 of file OdArray.h.

◆ destroyRange()

template<class T >
static void OdMemoryAllocator< T >::destroyRange ( T *  objects,
size_type  numObjects 
)
inlinestatic

Calls a destructor for elements at a destination range.

Parameters
objects[in] Array of objects.
numObjects[in] Number of objects.

Definition at line 316 of file OdArray.h.

◆ moveAssignRange()

template<class T >
static void OdMemoryAllocator< T >::moveAssignRange ( T *  pDestination,
T *  pSource,
size_type  numElements 
)
inlinestatic

This function performs a move assignment from a source range to a destination range (ranges may overlap).

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.
Remarks
If the source and destination regions overlap, the method moves the overlapping region before it is overwritten.

Definition at line 150 of file OdArray.h.

◆ moveConstruct()

template<class T >
static void OdMemoryAllocator< T >::moveConstruct ( T *  pElement,
T &&  value 
)
inlinestatic

This function performs a move constructor on one memory location.

Parameters
pElement[out] Receives the element.
value[in] Value for the element.

Definition at line 216 of file OdArray.h.

◆ moveConstructRange()

template<class T >
static void OdMemoryAllocator< T >::moveConstructRange ( T *  pDestination,
T *  pSource,
size_type  numElements 
)
inlinestatic

This function performs a move constructor from a source range to a destination range.

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.

Definition at line 274 of file OdArray.h.

◆ useRealloc()

template<class T >
static bool OdMemoryAllocator< T >::useRealloc ( )
inlinestatic

Indicates whether odrxRealloc can be used to resize an array.

Returns
The true value if odrxRealloc can be used to resize an array, or false otherwise.

Definition at line 328 of file OdArray.h.


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