UniqueHeap< SuperHeap, Child > Class Template Reference

Instantiates one instance of a class used for every malloc & free. More...

#include <unique.h>

List of all members.

Public Member Functions

 UniqueHeap (void)
 Ensure that the super heap gets created, and add a reference for every instance of unique heap.
 ~UniqueHeap (void)
 Delete one reference to the unique heap.
void * malloc (size_t sz)
void free (void *ptr)
size_t getSize (void *ptr)
int remove (void *ptr)
void clear (void)

Private Member Functions

void addRef (void)
 Add one reference.
int delRef (void)
 Delete one reference count.
int & getRefs (void)
 Internal accessor for reference count.
SuperHeapgetSuperHeap (void)
void doNothing (Child *)

Detailed Description

template<class SuperHeap, class Child = int>
class UniqueHeap< SuperHeap, Child >

Instantiates one instance of a class used for every malloc & free.

Author:
Emery Berger

Constructor & Destructor Documentation

template<class SuperHeap , class Child = int>
UniqueHeap< SuperHeap, Child >::UniqueHeap ( void   )  [inline]

Ensure that the super heap gets created, and add a reference for every instance of unique heap.

template<class SuperHeap , class Child = int>
UniqueHeap< SuperHeap, Child >::~UniqueHeap ( void   )  [inline]

Delete one reference to the unique heap.

When the number of references goes to zero, delete the super heap.


Member Function Documentation

template<class SuperHeap , class Child = int>
void UniqueHeap< SuperHeap, Child >::addRef ( void   )  [inline, private]

Add one reference.

template<class SuperHeap , class Child = int>
void UniqueHeap< SuperHeap, Child >::clear ( void   )  [inline]
template<class SuperHeap , class Child = int>
int UniqueHeap< SuperHeap, Child >::delRef ( void   )  [inline, private]

Delete one reference count.

template<class SuperHeap , class Child = int>
void UniqueHeap< SuperHeap, Child >::doNothing ( Child *   )  [inline, private]
template<class SuperHeap , class Child = int>
void UniqueHeap< SuperHeap, Child >::free ( void *  ptr  )  [inline]
template<class SuperHeap , class Child = int>
int& UniqueHeap< SuperHeap, Child >::getRefs ( void   )  [inline, private]

Internal accessor for reference count.

template<class SuperHeap , class Child = int>
size_t UniqueHeap< SuperHeap, Child >::getSize ( void *  ptr  )  [inline]
template<class SuperHeap , class Child = int>
SuperHeap* UniqueHeap< SuperHeap, Child >::getSuperHeap ( void   )  [inline, private]
template<class SuperHeap , class Child = int>
void* UniqueHeap< SuperHeap, Child >::malloc ( size_t  sz  )  [inline]
template<class SuperHeap , class Child = int>
int UniqueHeap< SuperHeap, Child >::remove ( void *  ptr  )  [inline]

The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:29 2011 for Galois by  doxygen 1.6.3