memory::retainable Class Reference

Base class for return-by-pointer memory management. More...

#include <retain.h>

Inheritance diagram for memory::retainable:
Inheritance graph
[legend]

List of all members.

Public Types

enum  pooltype { onstack }

Public Member Functions

 retainable (void)
virtual ~retainable (void)
void * operator new (size_t sz)
void operator delete (void *v)
void * operator new (size_t sz, pooltype r)
void operator delete (void *v, pooltype r)

Protected Member Functions

void retainvalue (retainable *r)
void destroyvalue (retainable *r)
virtual void init (bool first=true)

Detailed Description

Base class for return-by-pointer memory management.

Uses a custom allocator if the memory::retainable::onstack argument is given to new, in which case the memory will not be allocated through normal malloc(). Instead, a block is taken out of the preallocated memory pool.


Member Function Documentation

void memory::retainable::retainvalue ( retainable r  )  [protected]

Call this from any operator= or copy constructor methods.

References memory::pool::free(), and memory::pool::getsize().

Referenced by currency::currency(), and statstring::statstring().

Here is the call graph for this function:


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

Generated on Sun Feb 28 10:37:30 2010 for GRACE by  doxygen 1.6.1