Murl::Util::DeepCopy Namespace Reference

Object deep copy functions. More...

Functions

template<class DataType >
DataType * PlacementNew (DataType *dstPtr)
 Placement new an object with default constructor. More...
 
template<class DataType >
DataType * PlacementNew (DataType *dstPtr, const DataType &value)
 Placement new and copy construct an object. More...
 
template<class DataType >
void PlacementNewArray (DataType *dstPtr, const DataType *dstEnd)
 Placement new and default construct an array of objects. More...
 
template<class DataType >
void DestructArray (DataType *dstPtr, const DataType *dstEnd)
 Destruct an array of objects. More...
 
template<class DataType >
void PlacementNewCopyArray (DataType *dstPtr, const DataType *srcPtr, const DataType *srcEnd)
 Placement new and copy construct an array of objects. More...
 
template<class DataType >
void PlacementNewFillArray (DataType *dstPtr, const DataType *dstEnd, const DataType &value)
 Placement new and copy construct an array of objects from a single object. More...
 

Detailed Description

Object deep copy functions.

Function Documentation

◆ PlacementNew() [1/2]

template<class DataType >
DataType* Murl::Util::DeepCopy::PlacementNew ( DataType *  dstPtr)

Placement new an object with default constructor.

Parameters
dstPtrThe destination memory pointer.
Returns
The destination memory pointer.

Referenced by Murl::Array< DataType >::Add(), Murl::Queue< DataType >::AddHead(), and Murl::Queue< DataType >::AddTail().

◆ PlacementNew() [2/2]

template<class DataType >
DataType* Murl::Util::DeepCopy::PlacementNew ( DataType *  dstPtr,
const DataType &  value 
)

Placement new and copy construct an object.

Parameters
dstPtrThe destination memory pointer.
valueThe object to copy.
Returns
The destination memory pointer.

◆ PlacementNewArray()

template<class DataType >
void Murl::Util::DeepCopy::PlacementNewArray ( DataType *  dstPtr,
const DataType *  dstEnd 
)

Placement new and default construct an array of objects.

Parameters
dstPtrThe destination memory start pointer.
dstEndThe destination memory end pointer.

Referenced by Murl::Array< DataType >::AddN().

◆ DestructArray()

template<class DataType >
void Murl::Util::DeepCopy::DestructArray ( DataType *  dstPtr,
const DataType *  dstEnd 
)

Destruct an array of objects.

Parameters
dstPtrThe destination memory start pointer.
dstEndThe destination memory end pointer.

◆ PlacementNewCopyArray()

template<class DataType >
void Murl::Util::DeepCopy::PlacementNewCopyArray ( DataType *  dstPtr,
const DataType *  srcPtr,
const DataType *  srcEnd 
)

Placement new and copy construct an array of objects.

Overlapping memory blocks are not supported.

Parameters
dstPtrThe destination memory pointer.
srcPtrThe source memory start pointer.
srcEndThe source memory end pointer.

◆ PlacementNewFillArray()

template<class DataType >
void Murl::Util::DeepCopy::PlacementNewFillArray ( DataType *  dstPtr,
const DataType *  dstEnd,
const DataType &  value 
)

Placement new and copy construct an array of objects from a single object.

Parameters
dstPtrThe destination memory start pointer.
dstEndThe destination memory end pointer.
valueThe object to copy.


Copyright © 2011-2024 Spraylight GmbH.