Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 244 was 244, checked in by landauf, 16 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
RevLine 
[197]1#include "Identifier.h"
[218]2#include "Factory.h"
[244]3#include "ClassFactory.h"
[197]4#include "IdentifierList.h"
5#include "ObjectList.h"
[221]6#include "Iterator.h"
[197]7#include "OrxonoxClass.h"
[219]8
9
[244]10#define InternRegisterObject(ClassName, bRootClass) \
11    this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \
[219]12    if (Identifier::isCreatingHierarchy() && this->getParents()) \
13        this->getParents()->add(this->getIdentifier()); \
[224]14    ClassIdentifier<ClassName>::addObject(this)
[219]15
[244]16#define InternRegisterRootObject(ClassName) \
17    if (Identifier::isCreatingHierarchy() && !this->getParents()) \
18        this->setParents(new IdentifierList()); \
19    InternRegisterObject(ClassName, true)
[220]20
[231]21#if HIERARCHY_VERBOSE
[244]22#define RegisterObject(ClassName) \
[219]23    std::cout << "*** Register Object: " << #ClassName << "\n"; \
[244]24    InternRegisterObject(ClassName, false)
[231]25#else
[244]26#define RegisterObject(ClassName) \
27    InternRegisterObject(ClassName, false)
[231]28#endif
[219]29
[231]30#if HIERARCHY_VERBOSE
[244]31#define RegisterRootObject(ClassName) \
32    std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
33    InternRegisterRootObject(ClassName)
[231]34#else
[244]35#define RegisterRootObject(ClassName) \
36    InternRegisterRootObject(ClassName)
[231]37#endif
[219]38
[244]39#define UnregisterObject() \
[219]40    this->getIdentifier()->removeObject(this)
41
42#define Class(ClassName) \
43    ClassIdentifier<ClassName>::getIdentifier()
44
45#define CreateFactory(ClassName) \
[244]46    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
[219]47
[244]48#define ID(Name) \
49    Factory::getIdentifier(Name)
Note: See TracBrowser for help on using the repository browser.