Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | List of all members
om::util::AlignedAllocator< defaultAlignment > Class Template Reference

A class that allocates aligned memory from the global memory system. More...

#include <omAllocator.h>

Inheritance diagram for om::util::AlignedAllocator< defaultAlignment >:
om::util::Allocator

Public Member Functions

virtual UByteallocate (Size numBytes)
 Allocate the specified number of bytes and return a pointer to the uninitialized memory. More...
 
virtual void deallocate (void *pointer)
 Free the previously allocated memory block pointed to by the specified pointer. More...
 
- Public Member Functions inherited from om::util::Allocator
virtual ~Allocator ()
 Destroy this allocator. More...
 

Static Public Member Functions

template<typename T >
static T * allocate (Size count=Size(1), Size alignment=defaultAlignment)
 Allocate unitialized memory for the specified number of objects of type T. More...
 
template<typename T >
static void deallocate (T *pointer)
 Free the previously allocated memory block pointed to by the specified pointer. More...
 
- Static Public Member Functions inherited from om::util::Allocator
template<typename T >
static T * allocate (Size count=Size(1))
 Allocate unitialized memory for the specified number of objects of type T. More...
 
template<typename T >
static void deallocate (T *pointer)
 Free the previously allocated memory block pointed to by the specified pointer. More...
 
template<typename T >
static void construct (T *object)
 Call the default constructor of an object. More...
 
template<typename T , typename P1 >
static void construct (T *object, const P1 &p1)
 Call the constructor of an object with 1 constructor parameter. More...
 
template<typename T , typename P1 , typename P2 >
static void construct (T *object, const P1 &p1, const P2 &p2)
 Call the constructor of an object with 2 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3)
 Call the constructor of an object with 3 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Call the constructor of an object with 4 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Call the constructors of an array of objects with 5 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
 Call the constructor of an object with 6 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
 Call the constructor of an object with 7 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
 Call the constructor of an object with 8 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9)
 Call the constructor of an object with 9 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9 , typename P10 >
static void construct (T *object, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10)
 Call the constructor of an object with 10 constructor parameters. More...
 
template<typename T , typename SizeType >
static void constructArray (T *objects, SizeType number)
 Call the default constructors of an array of objects. More...
 
template<typename T , typename SizeType , typename P1 >
static void constructArray (T *objects, SizeType number, const P1 &p1)
 Call the constructors of an array of objects with 1 constructor parameter. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2)
 Call the constructors of an array of objects with 2 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3)
 Call the constructors of an array of objects with 3 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Call the constructors of an array of objects with 4 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Call the constructors of an array of objects with 5 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
 Call the constructors of an array of objects with 6 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
 Call the constructors of an array of objects with 7 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
 Call the constructors of an array of objects with 8 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9)
 Call the constructors of an array of objects with 9 constructor parameters. More...
 
template<typename T , typename SizeType , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 , typename P9 , typename P10 >
static void constructArray (T *objects, SizeType number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10)
 Call the constructors of an array of objects with 10 constructor parameters. More...
 
template<typename T >
static void destruct (T *object)
 Call the destructor on an object of the templated type. More...
 
template<typename T , typename SizeType >
static void destructArray (T *objects, SizeType number)
 Call the destructors on an array of objects of the templated type. More...
 
template<typename T , typename SizeType >
static void copyArray (T *destination, const T *source, SizeType number)
 Copy an array of objects by calling the placement-new copy constructor for each object. More...
 
template<typename T , typename SizeType >
static void moveArray (T *destination, T *source, SizeType number)
 Copy an array of objects from the source to destination with placement new, calling destructors on the source. More...
 

Detailed Description

template<Size defaultAlignment = Size(16)>
class om::util::AlignedAllocator< defaultAlignment >

A class that allocates aligned memory from the global memory system.

Member Function Documentation

template<Size defaultAlignment = Size(16)>
virtual UByte* om::util::AlignedAllocator< defaultAlignment >::allocate ( Size  numBytes)
inlinevirtual

Allocate the specified number of bytes and return a pointer to the uninitialized memory.

Reimplemented from om::util::Allocator.

template<Size defaultAlignment = Size(16)>
virtual void om::util::AlignedAllocator< defaultAlignment >::deallocate ( void *  pointer)
inlinevirtual

Free the previously allocated memory block pointed to by the specified pointer.

Reimplemented from om::util::Allocator.

template<Size defaultAlignment = Size(16)>
template<typename T >
static T* om::util::AlignedAllocator< defaultAlignment >::allocate ( Size  count = Size(1),
Size  alignment = defaultAlignment 
)
inlinestatic

Allocate unitialized memory for the specified number of objects of type T.

template<Size defaultAlignment = Size(16)>
template<typename T >
static void om::util::AlignedAllocator< defaultAlignment >::deallocate ( T *  pointer)
inlinestatic

Free the previously allocated memory block pointed to by the specified pointer.


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