Functions

sp::MemoryManager Namespace Reference

MemeoryManager namespace was particular desinged for safe memory allocation and destruction. More...

Functions

template<typename T >
void deleteMemory (T *&Buffer)
 Deletes the specified memory buffer savely. This function don't.
template<typename T >
void deleteBuffer (T *&Buffer)
 Deletes the specified memory buffer (array) savely.
template<typename T >
T * createMemory (const io::stringc &Description="Unknown") throw (std::bad_alloc)
 Allocates a new memory buffer and prints an error message if not enough memory is available.
template<typename T >
T * createBuffer (const s32 Count, const io::stringc &Description="Unknown") 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>
bool removeElement (L< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
bool removeElement (std::vector< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
bool removeElement (std::list< T * > &List, T *&Object, bool DeleteMemory=false, bool UniqueObject=true)
template<class T >
getElement (std::list< T > &List, u32 Index)
template<class T >
const T getElement (const std::list< T > &List, u32 Index)
template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
bool hasElement (const L< T > &List, const T &Object)
template<class T >
bool hasElement (const std::vector< T > &List, const T &Object)
template<class T >
bool hasElement (const std::list< T > &List, const T &Object)
template<class T , template< class TL, class Allocator=std::allocator< TL > > class L>
void deleteList (L< T * > &List)
template<class T >
void deleteList (std::vector< T * > &List)
template<class T >
void deleteList (std::list< T * > &List)

Detailed Description

MemeoryManager namespace was particular desinged for safe memory allocation and destruction.


Function Documentation

template<typename T >
T* sp::MemoryManager::createBuffer ( const s32  Count,
const io::stringc &  Description = "Unknown" 
) throw (std::bad_alloc)

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

template<typename T >
T* sp::MemoryManager::createMemory ( const io::stringc &  Description = "Unknown"  )  throw (std::bad_alloc)

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

template<typename T >
void sp::MemoryManager::deleteBuffer ( T *&  Buffer  ) 

Deletes the specified memory buffer (array) savely.

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

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 >
void sp::MemoryManager::deleteList ( std::vector< T * > &  List  ) 
template<typename T >
void sp::MemoryManager::deleteMemory ( T *&  Buffer  ) 

Deletes the specified memory buffer savely. This function don't.

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

Removes an element from the list.

Parameters:
[in,out] List Specifies the list (std::list or std::vector) from which the element is to be removed.
[in,out] Object Specifies the object (or rather element) which is to be removed.
[in] DeleteMemory Specifies whether the object is to be deleted or not.
[in] UniqueObject Specifies whether several objects can be removed or only one.
Returns:
True if the specified element could be removed from the list.
template<class T >
bool sp::MemoryManager::removeElement ( std::list< T * > &  List,
T *&  Object,
bool  DeleteMemory = false,
bool  UniqueObject = true 
)
template<class T >
bool sp::MemoryManager::removeElement ( std::vector< T * > &  List,
T *&  Object,
bool  DeleteMemory = false,
bool  UniqueObject = true 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines