1 | #include "Identifier.h" |
---|
2 | #include "Factory.h" |
---|
3 | #include "IdentifierList.h" |
---|
4 | #include "ObjectList.h" |
---|
5 | #include "Iterator.h" |
---|
6 | #include "OrxonoxClass.h" |
---|
7 | |
---|
8 | |
---|
9 | #define internRegisterRootObject(ClassName, bAbstract) \ |
---|
10 | if (Identifier::isCreatingHierarchy() && !this->getParents()) \ |
---|
11 | this->setParents(new IdentifierList()); \ |
---|
12 | this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, bAbstract)); \ |
---|
13 | if (Identifier::isCreatingHierarchy() && this->getParents()) \ |
---|
14 | this->getParents()->add(this->getIdentifier()); \ |
---|
15 | this->getIdentifier()->addObject(this) |
---|
16 | |
---|
17 | #define registerRootObject(ClassName) \ |
---|
18 | std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ |
---|
19 | internRegisterRootObject(ClassName, false) |
---|
20 | |
---|
21 | #define registerAbstractRootObject(ClassName) \ |
---|
22 | std::cout << "*** Register abstract Root-Object: " << #ClassName << "\n"; \ |
---|
23 | internRegisterRootObject(ClassName, true) |
---|
24 | |
---|
25 | #define internRegisterObject(ClassName, bAbstract) \ |
---|
26 | this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, bAbstract)); \ |
---|
27 | if (Identifier::isCreatingHierarchy() && this->getParents()) \ |
---|
28 | this->getParents()->add(this->getIdentifier()); \ |
---|
29 | this->getIdentifier()->addObject(this) |
---|
30 | |
---|
31 | #define registerObject(ClassName) \ |
---|
32 | std::cout << "*** Register Object: " << #ClassName << "\n"; \ |
---|
33 | internRegisterObject(ClassName, false) |
---|
34 | |
---|
35 | #define registerAbstractObject(ClassName) \ |
---|
36 | std::cout << "*** Register abstract Object: " << #ClassName << "\n"; \ |
---|
37 | internRegisterObject(ClassName, true) |
---|
38 | |
---|
39 | #define unregisterObject() \ |
---|
40 | this->getIdentifier()->removeObject(this) |
---|
41 | |
---|
42 | #define Class(ClassName) \ |
---|
43 | ClassIdentifier<ClassName>::getIdentifier() |
---|
44 | |
---|
45 | #define CreateFactory(ClassName) \ |
---|
46 | Identifier* global_##ClassName##_Identifier = ClassIdentifier<ClassName>::getIdentifier() |
---|
47 | |
---|
48 | #define Factory(Name) \ |
---|
49 | ClassFactory::fabricate(Name) |
---|