[197] | 1 | #include "Identifier.h" |
---|
[218] | 2 | #include "Factory.h" |
---|
[197] | 3 | #include "IdentifierList.h" |
---|
| 4 | #include "ObjectList.h" |
---|
[221] | 5 | #include "Iterator.h" |
---|
[197] | 6 | #include "OrxonoxClass.h" |
---|
[219] | 7 | |
---|
| 8 | |
---|
[220] | 9 | #define internRegisterRootObject(ClassName, bAbstract) \ |
---|
[219] | 10 | if (Identifier::isCreatingHierarchy() && !this->getParents()) \ |
---|
| 11 | this->setParents(new IdentifierList()); \ |
---|
[220] | 12 | this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, bAbstract)); \ |
---|
[219] | 13 | if (Identifier::isCreatingHierarchy() && this->getParents()) \ |
---|
| 14 | this->getParents()->add(this->getIdentifier()); \ |
---|
[224] | 15 | ClassIdentifier<ClassName>::addObject(this) |
---|
[219] | 16 | |
---|
[220] | 17 | #define registerRootObject(ClassName) \ |
---|
| 18 | std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ |
---|
| 19 | internRegisterRootObject(ClassName, false) |
---|
| 20 | |
---|
[219] | 21 | #define registerAbstractRootObject(ClassName) \ |
---|
[220] | 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)); \ |
---|
[219] | 27 | if (Identifier::isCreatingHierarchy() && this->getParents()) \ |
---|
| 28 | this->getParents()->add(this->getIdentifier()); \ |
---|
[224] | 29 | ClassIdentifier<ClassName>::addObject(this) |
---|
[219] | 30 | |
---|
| 31 | #define registerObject(ClassName) \ |
---|
| 32 | std::cout << "*** Register Object: " << #ClassName << "\n"; \ |
---|
[220] | 33 | internRegisterObject(ClassName, false) |
---|
[219] | 34 | |
---|
| 35 | #define registerAbstractObject(ClassName) \ |
---|
[220] | 36 | std::cout << "*** Register abstract Object: " << #ClassName << "\n"; \ |
---|
| 37 | internRegisterObject(ClassName, true) |
---|
[219] | 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) |
---|