tDecoratableManager< Decorated > Class Template Reference

manager class for decoratable classes More...

#include <tDecorator.h>

Inheritance diagram for tDecoratableManager< Decorated >:

Inheritance graph
[legend]
Collaboration diagram for tDecoratableManager< Decorated >:

Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static void * Allocate (size_t size, const char *classn, const char *file, int line)
 reserve space for an object of class Decorated, prepended with space for its decorators
static void * Allocate (size_t size)
static void Free (void *ptr, const char *classn, const char *file, int line)
 frees space reserved by Reseve() again
static void Free (void *ptr)
static tDecoratableManagerGetManager ()
 returns the static instance of this class

Private Types

typedef Decorated::DecoratableBase_ DecoratedBase
 typedef for the class that is registered with the decorator system

Private Member Functions

tDecoratableManagerBaseGetBase (tBoolToType< true >)
tDecoratableManagerBaseGetBase (tBoolToType< false >)
 tDecoratableManager ()

Classes

struct  tBoolToType


Detailed Description

template<class Decorated>
class tDecoratableManager< Decorated >

manager class for decoratable classes

Definition at line 193 of file tDecorator.h.


Member Typedef Documentation

template<class Decorated>
typedef Decorated::DecoratableBase_ tDecoratableManager< Decorated >::DecoratedBase [private]

typedef for the class that is registered with the decorator system

Definition at line 209 of file tDecorator.h.


Constructor & Destructor Documentation

template<class Decorated>
tDecoratableManager< Decorated >::tDecoratableManager (  )  [inline, private]

Definition at line 235 of file tDecorator.h.

00236     {
00237         base_ = GetBase( tBoolToType< tIsDecoratable< DecoratedBase >::DECORATABLE >() );
00238     }


Member Function Documentation

template<class Decorate>
void * tDecoratableManager< Decorate >::Allocate ( size_t  size,
const char *  classn,
const char *  file,
int  line 
) [inline, static]

reserve space for an object of class Decorated, prepended with space for its decorators

Parameters:
size size of the memory block to allocate
classn name of the class that is allocated
file name of the file this call comes from
line line in the file the call ocmes from
Returns:
the newly allocated block of memory, with space for decorators

Reimplemented from tDecoratableManagerBase.

Definition at line 352 of file tDecorator.h.

References tDecoratableManagerBase::Allocate(), and tDecoratableManager< Decorated >::GetManager().

Referenced by tDecoratableManager< Decorated >::Allocate().

00353 {
00354     // delegate to manager
00355     tDecoratableManagerBase & manager = GetManager();
00356     return manager.Allocate( size, classn, file, line );
00357 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Decorate>
void * tDecoratableManager< Decorate >::Allocate ( size_t  size  )  [inline, static]

Parameters:
size size of the memory block to allocate
Returns:
the newly allocated block of memory, with space for decorators

Definition at line 371 of file tDecorator.h.

References tDecoratableManager< Decorated >::Allocate().

00372 {
00373     return Allocate( size, "noclass", "nofile", 0 );
00374 }

Here is the call graph for this function:

template<class Decorate>
void tDecoratableManager< Decorate >::Free ( void *  ptr,
const char *  classn,
const char *  file,
int  line 
) [inline, static]

frees space reserved by Reseve() again

Parameters:
ptr pointer to the memory area to be freed
classn name of the class that is allocated
file name of the file this call comes from
line line in the file the call ocmes from

Reimplemented from tDecoratableManagerBase.

Definition at line 390 of file tDecorator.h.

References tDecoratableManagerBase::Free(), and tDecoratableManager< Decorated >::GetManager().

Referenced by tDecoratableManager< Decorated >::Free().

00391 {
00392     // deregister with manager
00393     tDecoratableManagerBase & manager = GetManager();
00394     manager.Free( ptr, classn, file, line );
00395 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Decorate>
void tDecoratableManager< Decorate >::Free ( void *  ptr  )  [inline, static]

Parameters:
ptr pointer to the memory area to be freed

Definition at line 408 of file tDecorator.h.

References tDecoratableManager< Decorated >::Free().

00409 {
00410     return Free( ptr, "noclass", "nofile", 0 );
00411 }

Here is the call graph for this function:

template<class Decorated>
static tDecoratableManager& tDecoratableManager< Decorated >::GetManager (  )  [inline, static]

returns the static instance of this class

Definition at line 205 of file tDecorator.h.

Referenced by tDecoratableManager< Decorated >::Allocate(), tDecoratableManager< Decorated >::Free(), tDecoratableManager< Decorated >::GetBase(), and tDecorator< DecoratedDerived, Decoration >::tDecorator().

00206     {
00207         static tDecoratableManager manager;
00208         return manager;
00209     };

Here is the caller graph for this function:

template<class Decorated>
tDecoratableManagerBase* tDecoratableManager< Decorated >::GetBase ( tBoolToType< true >   )  [inline, private]

Definition at line 217 of file tDecorator.h.

References b, d, tDecoratableManager< Decorated >::GetManager(), NULL, and tASSERT.

00218     {
00219 #ifdef DEBUG
00220         // check whether the beginnings of this and the base class are the same; the
00221         // offset calculation relies on that.
00222         Decorated * d = NULL;
00223         DecoratedBase * b = d;
00224         tASSERT( b == NULL );
00225 #endif
00226 
00227         return &tDecoratableManager< DecoratedBase >::GetManager();
00228     }

Here is the call graph for this function:

template<class Decorated>
tDecoratableManagerBase* tDecoratableManager< Decorated >::GetBase ( tBoolToType< false >   )  [inline, private]

Definition at line 230 of file tDecorator.h.

References NULL.

00231     {
00232         return NULL;
00233     }


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:56:04 2008 for Armagetron Advanced by  doxygen 1.5.4