CFx SDK Documentation  2020SP3
Public Types | Static Public Member Functions | List of all members
OdMemoryAllocator< T > Class Template Reference

#include <OdArray.h>

Public Types

typedef unsigned int size_type
 

Static Public Member Functions

static void copy (T *pDestination, const T *pSource, size_type numElements)
 
static void move (T *pDestination, const T *pSource, size_type numElements)
 
static void construct (T *pElement, const T &value=T())
 
static void constructn (T *pDestination, size_type numElements, const T &value)
 
static void constructn (T *pDestination, const T *pSource, size_type numElements)
 
static void constructn (T *pDestination, size_type numElements)
 
static void destroy (T *)
 
static void destroy (T *, size_type)
 
static bool useRealloc ()
 

Detailed Description

template<class T>
class OdMemoryAllocator< T >

This template class implements memory allocation functions within Teigha.

See also
TD_Db

<group Other_Classes>

Definition at line 48 of file OdArray.h.

Member Typedef Documentation

◆ size_type

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

Definition at line 51 of file OdArray.h.

Member Function Documentation

◆ construct()

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

This function constructs an element.

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

Definition at line 96 of file OdArray.h.

◆ constructn() [1/3]

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

This function constructs an array of elements.

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numElements[in] Number of elements.
Remarks
When called with two arguments, this function does nothing but return.

Definition at line 134 of file OdArray.h.

◆ constructn() [2/3]

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

This function constructs an array of elements.

Parameters
T*[in] Pointer to the destination.
size_type[in] Number of elements.
Remarks
When called with two arguments, this function does nothing but return.

Definition at line 153 of file OdArray.h.

◆ constructn() [3/3]

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

This function constructs an array of elements.

Parameters
pDestination[in] Pointer to the destination.
numElements[in] Number of elements.
value[in] Value for the elements.
Remarks
When called with two arguments, this function does nothing but return.

Definition at line 113 of file OdArray.h.

◆ copy()

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

This function copies the specified number of elements from source to destination.

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 this function is undefined. Use move() to handle overlapping regions.

Definition at line 62 of file OdArray.h.

◆ destroy() [1/2]

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

Destroys the specified element or elements.

Remarks
This function does nothing but return.

Definition at line 166 of file OdArray.h.

◆ destroy() [2/2]

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

Destroys the specified element or elements.

Remarks
This function does nothing but return.

Definition at line 177 of file OdArray.h.

◆ move()

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

This function copies the specified number of elements from source to destination.

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, move copies the overlapping region before it is overwritten.
Use copy() to handle non-overlapping regions.

Definition at line 83 of file OdArray.h.

◆ useRealloc()

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

Returns true if and only if odrxRealloc can be used to resize an array.

Remarks
This function always returns true.

Definition at line 189 of file OdArray.h.


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