CFx SDK Documentation  2020SP3
Public Types | Static Public Member Functions | List of all members
OdObjectsAllocator< 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 numObjects)
 
static void move (T *pDestination, const T *pSource, size_type numObjects)
 
static void construct (T *pObject)
 
static void construct (T *pObject, const T &value)
 
static void constructn (T *pDestination, size_type numObjects, const T &value)
 
static void constructn (T *pDestination, size_type numObjects)
 
static void constructn (T *pDestination, const T *pSource, size_type numObjects)
 
static void destroy (T *pObject)
 
static void destroy (T *objects, size_type numObjects)
 
static bool useRealloc ()
 

Detailed Description

template<class T>
class OdObjectsAllocator< T >

This template class implements object allocation functions within Teigha.

Remarks
This class is for objects that must be copied with the assignment operator. For objects that can be copied with memcpy(), see OdPlainObjectsAllocator.
See also
TD_Db

<group Other_Classes>

Definition at line 208 of file OdArray.h.

Member Typedef Documentation

◆ size_type

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

Definition at line 211 of file OdArray.h.

Member Function Documentation

◆ construct() [1/2]

template<class T >
static void OdObjectsAllocator< T >::construct ( T *  pObject)
inlinestatic

This function constructs an object.

Parameters
pObject[out] Receives the object.

Definition at line 271 of file OdArray.h.

◆ construct() [2/2]

template<class T >
static void OdObjectsAllocator< T >::construct ( T *  pObject,
const T &  value 
)
inlinestatic

This function constructs an object.

Parameters
pObject[out] Receives the object.
value[in] Value for the object.

Definition at line 285 of file OdArray.h.

◆ constructn() [1/3]

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

This function constructs an array of objects.

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numObjects[in] Number of objects.

Definition at line 333 of file OdArray.h.

◆ constructn() [2/3]

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

This function constructs an array of objects.

Parameters
pDestination[in] Pointer to the destination.
numObjects[in] Number of objects.

Definition at line 317 of file OdArray.h.

◆ constructn() [3/3]

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

This function constructs an array of objects.

Parameters
pDestination[in] Pointer to the destination.
numObjects[in] Number of objects.
value[in] Value for the objects.

Definition at line 301 of file OdArray.h.

◆ copy()

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

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

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

Definition at line 223 of file OdArray.h.

◆ destroy() [1/2]

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

Destroys the specified objects.

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

Definition at line 360 of file OdArray.h.

◆ destroy() [2/2]

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

Destroys the specified object.

Parameters
pObject[in] Pointer to the object.

Definition at line 349 of file OdArray.h.

◆ move()

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

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

Parameters
pDestination[in] Pointer to the destination.
pSource[in] Pointer to the source.
numObjects[in] Number of objects.
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 249 of file OdArray.h.

◆ useRealloc()

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

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

Remarks
This function always returns false.

Definition at line 375 of file OdArray.h.


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