Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchie/src/IdentifierIncludes.h @ 246

Last change on this file since 246 was 246, checked in by landauf, 12 years ago

added "MetaObjectList", containing the list-element of the ObjectList of all classes an object is registered in. this allowes much faster deleting of objects.

File size: 1.5 KB
Line 
1#include "Identifier.h"
2#include "Factory.h"
3#include "ClassFactory.h"
4//#include "IdentifierList.h"
5//#include "ObjectList.h"
6#include "Iterator.h"
7#include "OrxonoxClass.h"
8
9
10#define InternRegisterObject(ClassName, bRootClass) \
11    this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \
12    if (Identifier::isCreatingHierarchy() && this->getParents()) \
13        this->getParents()->add(this->getIdentifier()); \
14    ClassIdentifier<ClassName>::addObject(this)
15
16#define InternRegisterRootObject(ClassName) \
17    if (Identifier::isCreatingHierarchy() && !this->getParents()) \
18        this->setParents(new IdentifierList()); \
19    InternRegisterObject(ClassName, true)
20
21#if HIERARCHY_VERBOSE
22#define RegisterObject(ClassName) \
23    std::cout << "*** Register Object: " << #ClassName << "\n"; \
24    InternRegisterObject(ClassName, false)
25#else
26#define RegisterObject(ClassName) \
27    InternRegisterObject(ClassName, false)
28#endif
29
30#if HIERARCHY_VERBOSE
31#define RegisterRootObject(ClassName) \
32    std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
33    InternRegisterRootObject(ClassName)
34#else
35#define RegisterRootObject(ClassName) \
36    InternRegisterRootObject(ClassName)
37#endif
38
39#define Class(ClassName) \
40    ClassIdentifier<ClassName>::getIdentifier()
41
42#define CreateFactory(ClassName) \
43    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
44
45#define ID(Name) \
46    Factory::getIdentifier(Name)
Note: See TracBrowser for help on using the repository browser.