Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 246 was 246, checked in by landauf, 13 years ago

added "MetaObjectList", containing the list-element of the ObjectList of all classes an object is registered in. this allowes much faster deleting of objects.

File size: 1.5 KB
RevLine 
[197]1#include "Identifier.h"
[218]2#include "Factory.h"
[244]3#include "ClassFactory.h"
[246]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
39#define Class(ClassName) \
40    ClassIdentifier<ClassName>::getIdentifier()
41
42#define CreateFactory(ClassName) \
[244]43    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
[219]44
[244]45#define ID(Name) \
46    Factory::getIdentifier(Name)
Note: See TracBrowser for help on using the repository browser.