#include <tDecorator.h>
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 tDecoratableManager & | GetManager () |
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 | |
tDecoratableManagerBase * | GetBase (tBoolToType< true >) |
tDecoratableManagerBase * | GetBase (tBoolToType< false >) |
tDecoratableManager () | |
Classes | |
struct | tBoolToType |
Definition at line 193 of file tDecorator.h.
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.
tDecoratableManager< Decorated >::tDecoratableManager | ( | ) | [inline, private] |
Definition at line 235 of file tDecorator.h.
00236 { 00237 base_ = GetBase( tBoolToType< tIsDecoratable< DecoratedBase >::DECORATABLE >() ); 00238 }
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
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 |
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 }
void * tDecoratableManager< Decorate >::Allocate | ( | size_t | size | ) | [inline, static] |
size | size of the memory block to allocate |
Definition at line 371 of file tDecorator.h.
References tDecoratableManager< Decorated >::Allocate().
00372 { 00373 return Allocate( size, "noclass", "nofile", 0 ); 00374 }
void tDecoratableManager< Decorate >::Free | ( | void * | ptr, | |
const char * | classn, | |||
const char * | file, | |||
int | line | |||
) | [inline, static] |
frees space reserved by Reseve() again
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 }
void tDecoratableManager< Decorate >::Free | ( | void * | ptr | ) | [inline, static] |
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 }
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 };
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 }
tDecoratableManagerBase* tDecoratableManager< Decorated >::GetBase | ( | tBoolToType< false > | ) | [inline, private] |