Class for naming policy management when creating objects. More...
#include <NumberingPolicy.h>
Public Member Functions | |
DefaultNumberingPolicy () | |
Constructor. | |
virtual std::string | onCreate (void *obj) |
Create the name when creating object. | |
virtual void | onDelete (void *obj) |
Delete the name when deleting object. | |
virtual | ~DefaultNumberingPolicy (void) |
Destractor. | |
Protected Member Functions | |
long int | find (void *obj) |
Find the object. | |
Private Attributes | |
int | m_num |
std::vector< void * > | m_objects |
Class for naming policy management when creating objects.
This is a class to manage the naming policy when creating objects.
Definition at line 149 of file NumberingPolicy.h.
DefaultNumberingPolicy::DefaultNumberingPolicy | ( | ) | [inline] |
virtual DefaultNumberingPolicy::~DefaultNumberingPolicy | ( | void | ) | [inline, virtual] |
Destractor.
Definition at line 181 of file NumberingPolicy.h.
long int DefaultNumberingPolicy::find | ( | void * | obj | ) | [protected] |
Find the object.
Find the specified object in the object list and return its index when it is stored.
obj | The target object for the find |
Definition at line 78 of file NumberingPolicy.cpp.
std::string DefaultNumberingPolicy::onCreate | ( | void * | obj | ) | [virtual] |
Create the name when creating object.
Create the name when creating objects.
Create the name when creating object. Create the name corresponding to the number of generated instances.
obj | The target object for the name creation |
Implements NumberingPolicy.
Definition at line 33 of file NumberingPolicy.cpp.
void DefaultNumberingPolicy::onDelete | ( | void * | obj | ) | [virtual] |
Delete the name when deleting object.
Delete the name when deleting objects.
Delete the name when deleting object. Substract the generated number of instances when deleting the object.
obj | The target object for the name delete |
Implements NumberingPolicy.
Definition at line 60 of file NumberingPolicy.cpp.
int DefaultNumberingPolicy::m_num [private] |
Definition at line 262 of file NumberingPolicy.h.
std::vector<void*> DefaultNumberingPolicy::m_objects [private] |
Definition at line 263 of file NumberingPolicy.h.