Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/core/IdentifierIncludes.h @ 346

Last change on this file since 346 was 258, checked in by landauf, 17 years ago

merged object-hierarchy back to trunk

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