CrystalSpace

Public API Reference

csArraySafeCopyElementHandler< T > Class Template Reference
[Containers]

Special element handler for csArray that makes sure that when the array is reallocated that the objects are properly constructed and destructed at their new position. More...

#include <csutil/array.h>

List of all members.

Static Public Member Functions

static void MoveElements (T *mem, size_t dest, size_t src, size_t count)
 Move elements inside a region.
template<typename Allocator >
static T * ResizeRegion (Allocator &alloc, T *mem, size_t relevantcount, size_t oldcount, size_t newcount)
 Reallocates a region allocated by Allocator.

Detailed Description

template<class T>
class csArraySafeCopyElementHandler< T >

Special element handler for csArray that makes sure that when the array is reallocated that the objects are properly constructed and destructed at their new position.

This is needed for objects that can not be safely moved around in memory (like weak references). This is of course slower and that is the reason that this is not done by default.

Definition at line 165 of file array.h.


Member Function Documentation

template<class T >
static void csArraySafeCopyElementHandler< T >::MoveElements ( T *  mem,
size_t  dest,
size_t  src,
size_t  count 
) [inline, static]

Move elements inside a region.

Ensure that all elements are properly moved, ie they are copy-constructed at the new position in memory, the old instance is then destroyed.

Definition at line 226 of file array.h.

template<class T >
template<typename Allocator >
static T* csArraySafeCopyElementHandler< T >::ResizeRegion ( Allocator &  alloc,
T *  mem,
size_t  relevantcount,
size_t  oldcount,
size_t  newcount 
) [inline, static]

Reallocates a region allocated by Allocator.

Ensure that all elements are properly moved, ie they are copy-constructed at the new position in memory, the old instance is then destroyed.

Definition at line 195 of file array.h.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1