LCFIVertex  0.7.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vertex_lcfi::MemoryManager< T > Class Template Reference

Memory management. More...

#include <memorymanager.h>

Inheritance diagram for vertex_lcfi::MemoryManager< T >:
Inheritance graph
[legend]
Collaboration diagram for vertex_lcfi::MemoryManager< T >:
Collaboration graph
[legend]

Public Member Functions

virtual ~MemoryManager ()
 Destructor - will delete all held objects.
 
void registerObject (T *pointer)
 Register an object for memory management.
 
void delAll ()
 Delete all objects held by this MemoryManager.
 
virtual ~MemoryManager ()
 Destructor - will delete all held objects.
 
void registerObject (T *pointer)
 Register an object for memory management.
 
void delAll ()
 Delete all objects held by this MemoryManager.
 
- Public Member Functions inherited from vertex_lcfi::MemoryManagerType
virtual ~MemoryManagerType ()
 Empty Destructor.
 
virtual ~MemoryManagerType ()
 Empty Destructor.
 

Static Public Member Functions

static MemoryManager< T > * Event ()
 Returns the Event duration singleton instance of the MemoryManager for type T.
 
static MemoryManager< T > * Run ()
 Returns the Run duration singleton instance of the MemoryManager for type T.
 
static MemoryManager< T > * Event ()
 Returns the Event duration singleton instance of the MemoryManager for type T.
 
static MemoryManager< T > * Run ()
 Returns the Run duration singleton instance of the MemoryManager for type T.
 

Protected Member Functions

 MemoryManager ()
 Do not use.
 
 MemoryManager (const MemoryManager< T > &)
 Do not use.
 
MemoryManager< T > & operator= (const MemoryManager< T > &)
 Do not use.
 
 MemoryManager ()
 Do not use.
 
 MemoryManager (const MemoryManager< T > &)
 Do not use.
 
MemoryManager< T > & operator= (const MemoryManager< T > &)
 Do not use.
 

Detailed Description

template<class T>
class vertex_lcfi::MemoryManager< T >

Memory management.

Memory in the vertex package is handled on a run and event basis If you wish to have an object that lasts the length of the event then call:

myType* myObject = new myType(construction parameters);


MemoryManager<myType>::Event()->registerObject(myObject);


At the end of the event to free all objects of all types made using the above call:

MetaMemoryManager::Event()->delAllObjects();


Similarly for run lifetime objects, replacing Event with Run.

Definition at line 58 of file include/vertex_lcfi/util/inc/memorymanager.h.


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