C++ main module for stochmagnet Package  1.0
Public Member Functions | Private Attributes | List of all members
CORE_MemoryStack< T > Class Template Reference

CORE_MemoryStack is the class to register all the created classes to detect not destroyed classes. More...

#include <CORE_MemoryStack.h>

Public Member Functions

 CORE_MemoryStack ()
 build an instance of the object More...
 
virtual ~CORE_MemoryStack ()
 destroy the instance of object More...
 
tMemSize getMemorySize () const
 return the memory size in byte More...
 
tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
void registerClass (const T *obj)
 register the object More...
 
void unregisterClass (const T *obj)
 unregister the object More...
 
tIndex getRegistredClassesNumber () const
 retunr the number of registred elements More...
 
std::string toString () const
 print all the registred classes More...
 

Private Attributes

std::map< std::string, const T * > mObjects
 

Detailed Description

template<class T>
class CORE_MemoryStack< T >

CORE_MemoryStack is the class to register all the created classes to detect not destroyed classes.

Constructor & Destructor Documentation

◆ CORE_MemoryStack()

template<class T >
CORE_MemoryStack< T >::CORE_MemoryStack ( )
inline

build an instance of the object

◆ ~CORE_MemoryStack()

template<class T >
virtual CORE_MemoryStack< T >::~CORE_MemoryStack ( )
inlinevirtual

destroy the instance of object

Member Function Documentation

◆ getContentsMemorySize()

template<class T >
tMemSize CORE_MemoryStack< T >::getContentsMemorySize ( ) const
inline

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

References CORE_MemoryStack< T >::mObjects, and tString.

Referenced by CORE_MemoryStack< T >::getMemorySize().

Here is the caller graph for this function:

◆ getMemorySize()

template<class T >
tMemSize CORE_MemoryStack< T >::getMemorySize ( ) const
inline

return the memory size in byte

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

References CORE_MemoryStack< T >::getContentsMemorySize().

Here is the call graph for this function:

◆ getRegistredClassesNumber()

template<class T >
tIndex CORE_MemoryStack< T >::getRegistredClassesNumber ( ) const
inline

retunr the number of registred elements

Returns
the number of object classes created

References CORE_MemoryStack< T >::mObjects.

◆ registerClass()

template<class T >
void CORE_MemoryStack< T >::registerClass ( const T *  obj)
inline

register the object

Parameters
[in]objobject to register

References ASSERT_IN, CORE_MemoryStack< T >::mObjects, and core_functions::pointerToString().

Here is the call graph for this function:

◆ toString()

template<class T >
std::string CORE_MemoryStack< T >::toString ( ) const
inline

print all the registred classes

Returns
the string with all the registered classes

References CORE_MemoryStack< T >::mObjects, and tInteger.

◆ unregisterClass()

template<class T >
void CORE_MemoryStack< T >::unregisterClass ( const T *  obj)
inline

unregister the object

Parameters
[in]objobject to unregister

References ASSERT_IN, CORE_MemoryStack< T >::mObjects, and core_functions::pointerToString().

Here is the call graph for this function:

Member Data Documentation

◆ mObjects

template<class T >
std::map<std::string,const T*> CORE_MemoryStack< T >::mObjects
private

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