77 #ifndef _CoreIncludes_H__ 78 #define _CoreIncludes_H__ 89 #if defined(ORXONOX_PLATFORM_WINDOWS) 90 # define WIN32_LEAN_AND_MEAN 100 #define RegisterClass(ClassName) \ 101 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), true) 107 #define RegisterClassNoArgs(ClassName) \ 108 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryNoArgs<ClassName>(), true) 114 #define RegisterUnloadableClass(ClassName) \ 115 RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), false) 121 #define RegisterAbstractClass(ClassName) \ 122 RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>(nullptr), false) 130 #define RegisterClassWithFactory(ClassName, FactoryInstance, bLoadable) \ 131 orxonox::SI_I& _##ClassName##Identifier = (*new orxonox::SI_I(orxonox::registerClass<ClassName>(#ClassName, FactoryInstance, bLoadable))) 137 #define RegisterObject(ClassName) \ 138 if (ClassIdentifier<ClassName>::getIdentifier()->initializeObject(this)) \ 147 #define Class(ClassName) \ 148 orxonox::ClassIdentifier<ClassName>::getIdentifier() 159 return registerClass<T>(name,
static_cast<Factory*
>(factory), bLoadable);
231 , identifier_(identifier)
246 {
return *this->identifier_; }
253 { this->identifier_->setVirtualBase(
true);
return *
this; }
StaticallyInitializedIdentifier SI_I
Definition: CoreIncludes.h:259
StaticallyInitializedIdentifier & virtualBase()
Definition: CoreIncludes.h:252
The ClassIdentifier is derived from Identifier and holds all class-specific functions and variables t...
Definition: Identifier.h:262
Identifier * ClassByString(const std::string &name)
Returns the Identifier with a given name.
Definition: CoreIncludes.h:178
void addIdentifier(Identifier *identifier)
Registers the identifier in all maps of the IdentifierManager.
Definition: IdentifierManager.cc:57
~StaticallyInitializedIdentifier()
Definition: CoreIncludes.h:233
void removeIdentifier(Identifier *identifier)
Unregisters the identifier from all maps of the IdentifierManager.
Definition: IdentifierManager.cc:71
Identifier * identifier_
Definition: CoreIncludes.h:256
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
virtual void load() override
Definition: CoreIncludes.h:235
Identifier * ClassByLowercaseString(const std::string &name)
Returns the Identifier with a given lowercase name.
Definition: CoreIncludes.h:187
helper class to manually define inheritance
Definition: Identifier.h:112
virtual Identifier * getParent() const override
Definition: CoreIncludes.h:225
static constexpr Type IDENTIFIER
Definition: CorePrereqs.h:94
static ClassIdentifier< T > * getIdentifier()
Returns the only instance of this class.
Definition: Identifier.h:329
StaticallyInitializedIdentifier(Identifier *identifier)
Definition: CoreIncludes.h:229
Identifier * ClassByID(uint32_t id)
Returns the Identifier with a given network ID.
Definition: CoreIncludes.h:196
The ClassFactory is the base-class of all class-spezific factories.
Definition: CorePrereqs.h:149
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Definition: CoreIncludes.h:223
Definition: StaticallyInitializedInstance.h:36
#define _CoreExport
Definition: CorePrereqs.h:61
Identifier * getIdentifierByID(uint32_t id)
Returns the Identifier with a given network ID.
Definition: IdentifierManager.cc:246
The Identifier is used to identify the class of an object and to store information about the class...
Definition: Identifier.h:109
Identifier * ClassByObjectType(const T *p)
Returns the Identifier with a given 'this' pointer.
Definition: CoreIncludes.h:208
Defines the helper function orxout() and includes all necessary headers to use the output system...
Definition: InputPrereqs.h:78
StaticallyInitializedIdentifier & inheritsFrom()
Definition: CoreIncludes.h:249
Definition of the ObjectList class, a wrapper of ObjectListBase.
Identifier * registerClass(const std::string &name, ClassFactory< T > *factory, bool bLoadable=true)
Overload of registerClass() which determines T implicitly by the template argument of the ClassFactor...
Definition: CoreIncludes.h:157
Identifier * getIdentifierByString(const std::string &name)
Returns the Identifier with a given name.
Definition: IdentifierManager.cc:218
The static initializer stores the parent classes of this identifier.
Definition: CoreIncludes.h:220
Identifier & getIdentifier()
Definition: CoreIncludes.h:245
Identifier * getIdentifierByLowercaseString(const std::string &name)
Returns the Identifier with a given name in lowercase.
Definition: IdentifierManager.cc:232
static IdentifierManager & getInstance()
Returns a reference to the singleton instance.
Definition: Singleton.h:118
Base-class of all factories.
Definition: ClassFactory.h:52
virtual void unload() override
Definition: CoreIncludes.h:240
Definition and implementation of the ClassFactory class.
#define Class(ClassName)
Returns the Identifier of the given class.
Definition: CoreIncludes.h:147