Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

reimplementation of the factory and parts of the class-hierarchy-generating-algorithm. interfaces with protected constructors are now allowed.

File size: 1.6 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 UnregisterObject() \
40    this->getIdentifier()->removeObject(this)
41
42#define Class(ClassName) \
43    ClassIdentifier<ClassName>::getIdentifier()
44
45#define CreateFactory(ClassName) \
46    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
47
48#define ID(Name) \
49    Factory::getIdentifier(Name)
Note: See TracBrowser for help on using the repository browser.