#include <BasicDynamicClassFactory.h>
Collaboration diagram for BasicDynamicClassFactory:
Public Member Functions | |
BasicDynamicClassFactory () | |
void * | create () |
This function will allocate one contiguous block of memory the size of the sum of the sizes of the registered class nodes. | |
void | destroy (void *x) |
Deallocate a dynamic class. | |
unsigned int | getClassSize () |
The current total size of the dynamic class. | |
unsigned int | getNumNodes () |
The current number of nodes in this dynamic class factory. | |
unsigned int | getNumClasses () |
The current number of existing instances of the dynamic class. | |
Protected Member Functions | |
void | registerNode (BasicDynamicClassNodeBase *node) |
This function is only callable by BasicDynamicClassNodeBase. | |
Private Attributes | |
unsigned int | classSize |
unsigned int | numClasses |
BasicArray< BasicDynamicClassNodeBase * > | nodes |
BasicDynamicClassNode(s) can be be registered with an instance of a BasicDynamicClassFactory to create type safe dynamically aggregated classes.
Pros:
Cons:
Don't use this class unless you know why and how to use it.
See also this similar class BasicClassGroupFactory.
|
|
|
This function will allocate one contiguous block of memory the size of the sum of the sizes of the registered class nodes. If the registered class nodes have overridden the BasicDynamicClassNode::init() function it will be called first. WARNING the constructors of the dynamic class nodes are NOT called.
|
|
Deallocate a dynamic class. WARNING the destructors are NOT called.
|
|
The current total size of the dynamic class.
|
|
The current number of existing instances of the dynamic class.
|
|
The current number of nodes in this dynamic class factory.
|
|
This function is only callable by BasicDynamicClassNodeBase. |
|
|
|
|
|
|