Om  1.0.0
A universal framework for multimedia simulation
Classes | Namespaces | Functions
omAllocator.h File Reference
#include "omUtilitiesConfig.h"

Classes

class  om::util::Allocator
 A class that represents the interface for objects that allocate memory. More...
 
class  om::util::AlignedAllocator< defaultAlignment >
 A class that allocates aligned memory from the global memory system. More...
 

Namespaces

 om
 The enclosing namespace for the entire Om library.
 
 om::util
 A namespace containing data structure classes and memory manipulation functions.
 

Functions

template<typename T >
T * om::util::allocate ()
 Allocate memory for a single object of type T. More...
 
template<typename T >
T * om::util::allocate (Size count)
 Allocate memory for the specified number of objects of type T. More...
 
template<typename T >
T * om::util::allocateAligned (Size count, Size alignment=Size(16))
 Allocate memory for the specified number of objects of type T. More...
 
template<typename T >
void om::util::deallocate (T *pointer)
 Free the memory block pointed to by the specified pointer. More...
 
template<typename T >
void om::util::deallocateAligned (T *pointer)
 Free the aligned memory block pointed to by the specified pointer. More...
 
template<typename T >
T * om::util::construct ()
 Construct and allocate an object of the templated type T, calling the default constructor. More...
 
template<typename T , typename P1 >
T * om::util::construct (const P1 &p1)
 Construct and allocate an object of the templated type T with one constructor parameter. More...
 
template<typename T , typename P1 , typename P2 >
T * om::util::construct (const P1 &p1, const P2 &p2)
 Construct and allocate an object of the templated type T with 2 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3)
 Construct and allocate an object of the templated type T with 3 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Construct and allocate an object of the templated type T with 4 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Construct and allocate an object of the templated type T with 5 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
 Construct and allocate an object of the templated type T with 6 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
 Construct and allocate an object of the templated type T with 7 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
T * om::util::construct (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
 Construct and allocate an object of the templated type T 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 >
T * om::util::construct (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)
 Construct and allocate an object of the templated type T 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 >
T * om::util::construct (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)
 Construct and allocate an object of the templated type T with 10 constructor parameters. More...
 
template<typename T >
void om::util::destruct (T *object)
 Destruct and free an object of the templated type T at the specified location. More...
 
template<typename T >
void om::util::destructAligned (T *object)
 Destruct and free an object of the templated type T at the specified location. More...
 
template<typename T >
T * om::util::constructArray (Size number)
 Construct and allocate an array of objects of the templated type T, calling the default constructor. More...
 
template<typename T , typename P1 >
T * om::util::constructArray (Size number, const P1 &p1)
 Construct and allocate an array of objects of the templated type T with one constructor parameter. More...
 
template<typename T , typename P1 , typename P2 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2)
 Construct and allocate an array of objects of the templated type T with 2 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2, const P3 &p3)
 Construct and allocate an array of objects of the templated type T with 3 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Construct and allocate an array of objects of the templated type T with 4 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Construct and allocate an array of objects of the templated type T with 5 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
 Construct and allocate an array of objects of the templated type T with 6 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
void om::util::constructArray (Size number, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
 Construct and allocate an array of objects of the templated type T with 7 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
void om::util::constructArray (Size 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)
 Construct and allocate an array of objects of the templated type T 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 >
void om::util::constructArray (Size 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)
 Construct and allocate an array of objects of the templated type T 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 >
void om::util::constructArray (Size 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)
 Construct and allocate an array of objects of the templated type T with 10 constructor parameters. More...
 
template<typename T >
T * om::util::constructArrayAligned (Size number, Size alignment)
 Construct and allocate an array of objects of the templated type T, calling the default constructor. More...
 
template<typename T , typename P1 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1)
 Construct and allocate an array of objects of the templated type T with one constructor parameter. More...
 
template<typename T , typename P1 , typename P2 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2)
 Construct and allocate an array of objects of the templated type T with 2 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3)
 Construct and allocate an array of objects of the templated type T with 3 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Construct and allocate an array of objects of the templated type T with 4 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Construct and allocate an array of objects of the templated type T with 5 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
 Construct and allocate an array of objects of the templated type T with 6 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
 Construct and allocate an array of objects of the templated type T with 7 constructor parameters. More...
 
template<typename T , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 , typename P8 >
T * om::util::constructArrayAligned (Size number, Size alignment, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
 Construct and allocate an array of objects of the templated type T 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 >
T * om::util::constructArrayAligned (Size number, Size alignment, 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)
 Construct and allocate an array of objects of the templated type T 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 >
T * om::util::constructArrayAligned (Size number, Size alignment, 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)
 Construct and allocate an array of objects of the templated type T with 10 constructor parameters. More...
 
template<typename T >
T * om::util::copyArray (const T *oldArray, Size number)
 Allocate a new array and copy the specified number of elements from an old array. More...
 
template<typename T >
T * om::util::copyArrayAligned (const T *oldArray, Size number, Size alignment)
 Allocate a new aligned array and copy the specified number of elements from an old array. More...
 
template<typename T >
void om::util::destructArray (T *objects, Size number)
 Destruct and free an array of objects of the templated type T at the specified location. More...
 
template<typename T >
void om::util::destructArrayAligned (T *objects, Size number)
 Destruct and free an array of objects of the templated type T at the specified location. More...