Static Public Member Functions

sp::MemoryManager Class Reference

MemeoryManager class can be used to handle the STL vector and list objects easily. More...

#include <spMemoryManagement.hpp>

List of all members.

Static Public Member Functions

template<typename T >
static void deleteMemory (T *&Buffer)
 Deletes the specified memory buffer savely.
template<typename T >
static void deleteBuffer (T *&Buffer)
 Deletes the specified memory buffer (array) savely.
template<typename T >
static T * createMemory () throw (std::bad_alloc)
 Allocates a new memory buffer and prints an error message if not enough memory is available.
template<typename T >
static T * createBuffer (const s32 Count) throw (std::bad_alloc)
 Allocates a new memory buffer (array) and prints an error message if not enough memory is available.
template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
static void removeElement (L< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
static void removeElement (std::vector< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
static void removeElement (std::list< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
static T getElement (std::list< T > &List, u32 Index)
template<class T >
static const T getElement (const std::list< T > &List, u32 Index)
template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
static void deleteList (L< T * > &List)
template<class T >
static void deleteList (std::vector< T * > &List)
template<class T >
static void deleteList (std::list< T * > &List)

Detailed Description

MemeoryManager class can be used to handle the STL vector and list objects easily.


Member Function Documentation

template<typename T >
static T* sp::MemoryManager::createBuffer ( const s32  Count  )  throw (std::bad_alloc) [inline, static]

Allocates a new memory buffer (array) and prints an error message if not enough memory is available.

template<typename T >
static T* sp::MemoryManager::createMemory (  )  throw (std::bad_alloc) [inline, static]

Allocates a new memory buffer and prints an error message if not enough memory is available.

template<typename T >
static void sp::MemoryManager::deleteBuffer ( T *&  Buffer  )  [inline, static]

Deletes the specified memory buffer (array) savely.

template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
static void sp::MemoryManager::deleteList ( L< T * > &  List  )  [inline, static]

Deletes all elements of a list.

Parameters:
List,: Specifies the list (std::list or std::vector) from which each elements are to be deleted.
template<class T >
static void sp::MemoryManager::deleteList ( std::vector< T * > &  List  )  [inline, static]
template<class T >
static void sp::MemoryManager::deleteList ( std::list< T * > &  List  )  [inline, static]
template<typename T >
static void sp::MemoryManager::deleteMemory ( T *&  Buffer  )  [inline, static]

Deletes the specified memory buffer savely.

template<class T >
static const T sp::MemoryManager::getElement ( const std::list< T > &  List,
u32  Index 
) [inline, static]
template<class T >
static T sp::MemoryManager::getElement ( std::list< T > &  List,
u32  Index 
) [inline, static]
template<class T >
static void sp::MemoryManager::removeElement ( std::list< T * > &  List,
T *&  Object,
bool  DeleteMemory = false,
bool  UniqueObject = true 
) [inline, static]
template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
static void sp::MemoryManager::removeElement ( L< T * > &  List,
T *&  Object,
bool  DeleteMemory = false,
bool  UniqueObject = true 
) [inline, static]

Removes an element from the list.

Parameters:
List,: Specifies the list (std::list or std::vector) from which the element is to be removed.
Object,: Specifies the object (or rather element) which is to be removed.
DeleteMemory,: Specifies whether the object is to be deleted or not.
UniqueObject,: Specifies whether several objects can be removed or only one.
template<class T >
static void sp::MemoryManager::removeElement ( std::vector< T * > &  List,
T *&  Object,
bool  DeleteMemory = false,
bool  UniqueObject = true 
) [inline, static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines