[197] | 1 | #include "Identifier.h" |
---|
[218] | 2 | #include "Factory.h" |
---|
[244] | 3 | #include "ClassFactory.h" |
---|
[221] | 4 | #include "Iterator.h" |
---|
[197] | 5 | #include "OrxonoxClass.h" |
---|
[219] | 6 | |
---|
| 7 | |
---|
[244] | 8 | #define InternRegisterObject(ClassName, bRootClass) \ |
---|
| 9 | this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \ |
---|
[219] | 10 | if (Identifier::isCreatingHierarchy() && this->getParents()) \ |
---|
| 11 | this->getParents()->add(this->getIdentifier()); \ |
---|
[224] | 12 | ClassIdentifier<ClassName>::addObject(this) |
---|
[219] | 13 | |
---|
[244] | 14 | #define InternRegisterRootObject(ClassName) \ |
---|
| 15 | if (Identifier::isCreatingHierarchy() && !this->getParents()) \ |
---|
| 16 | this->setParents(new IdentifierList()); \ |
---|
| 17 | InternRegisterObject(ClassName, true) |
---|
[220] | 18 | |
---|
[231] | 19 | #if HIERARCHY_VERBOSE |
---|
[244] | 20 | #define RegisterObject(ClassName) \ |
---|
[219] | 21 | std::cout << "*** Register Object: " << #ClassName << "\n"; \ |
---|
[244] | 22 | InternRegisterObject(ClassName, false) |
---|
[231] | 23 | #else |
---|
[244] | 24 | #define RegisterObject(ClassName) \ |
---|
| 25 | InternRegisterObject(ClassName, false) |
---|
[231] | 26 | #endif |
---|
[219] | 27 | |
---|
[231] | 28 | #if HIERARCHY_VERBOSE |
---|
[244] | 29 | #define RegisterRootObject(ClassName) \ |
---|
| 30 | std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ |
---|
| 31 | InternRegisterRootObject(ClassName) |
---|
[231] | 32 | #else |
---|
[244] | 33 | #define RegisterRootObject(ClassName) \ |
---|
| 34 | InternRegisterRootObject(ClassName) |
---|
[231] | 35 | #endif |
---|
[219] | 36 | |
---|
| 37 | #define Class(ClassName) \ |
---|
| 38 | ClassIdentifier<ClassName>::getIdentifier() |
---|
| 39 | |
---|
| 40 | #define CreateFactory(ClassName) \ |
---|
[244] | 41 | bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create() |
---|
[219] | 42 | |
---|
[244] | 43 | #define ID(Name) \ |
---|
| 44 | Factory::getIdentifier(Name) |
---|