90 #define SUPER_FUNCTION(functionnumber, baseclass, functionname, purevirtualbase) \ 91 template <class T, int templatehack2> \ 92 struct SuperFunctionCondition<functionnumber, T, 0, templatehack2> \ 94 static void superCheck() \ 96 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(nullptr)); \ 97 SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \ 100 static void apply(void*) {} \ 102 static void apply(baseclass*) \ 104 ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \ 105 for (const Identifier* child : identifier->getDirectChildren()) \ 107 if (((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \ 109 delete ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_; \ 110 ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = nullptr; \ 111 ((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ = false; \ 114 if (!((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \ 116 orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)child)->getName() << endl; \ 117 ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \ 119 else if (((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \ 120 orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)child)->getName() << " calls function of " << ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \ 125 SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND##purevirtualbase(functionnumber, baseclass) 127 #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND0(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass) 128 #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND1(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) 129 #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass) 130 #define SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) \ 131 template <int templatehack2> \ 132 struct SuperFunctionCondition<functionnumber, baseclass, 0, templatehack2> \ 134 static void superCheck() \ 136 SuperFunctionCondition<functionnumber + 1, baseclass, 0, templatehack2>::superCheck(); \ 217 #ifdef ORXONOX_COMPILER_MSVC 218 #define SUPER(classname, functionname, ...) \ 219 __super::functionname(__VA_ARGS__) 221 #define SUPER(classname, functionname, ...) \ 222 SUPER_##functionname(classname, functionname, __VA_ARGS__) 226 #define SUPER_NOARGS(classname, functionname) \ 227 (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this) 230 #define SUPER_ARGS(classname, functionname, ...) \ 231 (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this, __VA_ARGS__) 249 #define SUPER_XMLPort(classname, functionname, ...) \ 250 SUPER_ARGS(classname, functionname, __VA_ARGS__) 252 #define SUPER_tick(classname, functionname, ...) \ 253 SUPER_ARGS(classname, functionname, __VA_ARGS__) 255 #define SUPER_changedActivity(classname, functionname, ...) \ 256 SUPER_NOARGS(classname, functionname) 258 #define SUPER_changedVisibility(classname, functionname, ...) \ 259 SUPER_NOARGS(classname, functionname) 261 #define SUPER_XMLEventPort(classname, functionname, ...) \ 262 SUPER_ARGS(classname, functionname, __VA_ARGS__) 264 #define SUPER_changedScale(classname, functionname, ...) \ 265 SUPER_NOARGS(classname, functionname) 267 #define SUPER_changedOwner(classname, functionname, ...) \ 268 SUPER_NOARGS(classname, functionname) 270 #define SUPER_changedOverlayGroup(classname, functionname, ...) \ 271 SUPER_NOARGS(classname, functionname) 273 #define SUPER_changedName(classname, functionname, ...) \ 274 SUPER_NOARGS(classname, functionname) 276 #define SUPER_changedUsed(classname, functionname, ...) \ 277 SUPER_NOARGS(classname, functionname) 279 #define SUPER_changedCarrier(classname, functionname, ...) \ 280 SUPER_NOARGS(classname, functionname) 282 #define SUPER_changedPickedUp(classname, functionname, ...) \ 283 SUPER_NOARGS(classname, functionname) 300 template <
int functionnumber,
class T,
int templatehack1,
int templatehack2>
309 template <
int functionnumber,
class T>
318 template <
int functionnumber,
class T>
334 #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments, ...) \ 335 template <class T, int templatehack1, int templatehack2> \ 336 struct SuperFunctionCondition<functionnumber, T, templatehack1, templatehack2> \ 338 static void superCheck() \ 340 SuperFunctionCondition<functionnumber + 1, T, templatehack1, templatehack2>::superCheck(); \ 344 class _CoreExport SuperFunctionCaller_##functionname \ 347 virtual void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) = 0; \ 348 virtual ~SuperFunctionCaller_##functionname () {} \ 349 virtual Identifier* getParentIdentifier() const = 0; \ 353 class SuperFunctionClassCaller_purevirtualfallback_##functionname : public SuperFunctionCaller_##functionname \ 356 inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \ 360 Identifier* getParentIdentifier() const \ 362 return ClassIdentifier<T>::getIdentifier(); \ 367 struct SuperFunctionInitialization<functionnumber, T> \ 369 static void initialize(ClassIdentifier<T>* identifier) \ 371 identifier->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_purevirtualfallback_##functionname <T>; \ 372 identifier->bSuperFunctionCaller_##functionname##_isFallback_ = true; \ 373 SuperFunctionInitialization<functionnumber + 1, T>::initialize(identifier); \ 378 struct SuperFunctionDestruction<functionnumber, T> \ 380 static void destroy(ClassIdentifier<T>* identifier) \ 382 if (identifier->superFunctionCaller_##functionname##_) \ 383 delete identifier->superFunctionCaller_##functionname##_; \ 384 SuperFunctionDestruction<functionnumber + 1, T>::destroy(identifier); \ 389 class SuperFunctionClassCaller_##functionname : public SuperFunctionCaller_##functionname \ 392 inline void operator()( SUPER_CALL_ARGUMENTS##hasarguments(__VA_ARGS__) ) \ 394 (orxonox_cast<T*>(object))->T:: functionname 405 #define SUPER_FUNCTION_GLOBAL_DECLARATION_PART2 \ 409 Identifier* getParentIdentifier() const \ 411 return ClassIdentifier<T>::getIdentifier(); \ 415 #define SUPER_CALL_ARGUMENTSfalse(...) Identifiable* object 416 #define SUPER_CALL_ARGUMENTS0(...) Identifiable* object 417 #define SUPER_CALL_ARGUMENTStrue(...) Identifiable* object, __VA_ARGS__ 418 #define SUPER_CALL_ARGUMENTS1(...) Identifiable* object, __VA_ARGS__ 571 #ifdef SUPER_INTRUSIVE_DECLARATION_INCLUDE 581 template <
int functionnumber,
class TT,
int templatehack1,
int templatehack2>
586 virtual void createSuperFunctionCaller()
const override 599 #ifndef SUPER_INTRUSIVE_DECLARATION 600 #define SUPER_INTRUSIVE_DECLARATION(functionname) \ 601 SuperFunctionCaller_##functionname * superFunctionCaller_##functionname##_; \ 602 bool bSuperFunctionCaller_##functionname##_isFallback_ 609 SUPER_INTRUSIVE_DECLARATION(XMLPort);
610 SUPER_INTRUSIVE_DECLARATION(tick);
611 SUPER_INTRUSIVE_DECLARATION(changedActivity);
612 SUPER_INTRUSIVE_DECLARATION(changedVisibility);
613 SUPER_INTRUSIVE_DECLARATION(XMLEventPort);
614 SUPER_INTRUSIVE_DECLARATION(changedScale);
615 SUPER_INTRUSIVE_DECLARATION(changedOwner);
616 SUPER_INTRUSIVE_DECLARATION(changedOverlayGroup);
617 SUPER_INTRUSIVE_DECLARATION(changedName);
618 SUPER_INTRUSIVE_DECLARATION(changedUsed);
619 SUPER_INTRUSIVE_DECLARATION(changedCarrier);
620 SUPER_INTRUSIVE_DECLARATION(changedPickedUp);
624 #undef SUPER_INTRUSIVE_DECLARATION_INCLUDE static void destroy(ClassIdentifier< T > *)
Definition: Super.h:321
The ClassIdentifier is derived from Identifier and holds all class-specific functions and variables t...
Definition: Identifier.h:262
mode SUPER_FUNCTION_GLOBAL_DECLARATION_PART2
Definition: Super.h:519
static void initialize(ClassIdentifier< T > *)
Definition: Super.h:312
Creates the SuperFunctionCaller if T is a child of the super-functions baseclass. ...
Definition: Super.h:301
Shared library macros, enums, constants and forward declarations for the core library ...
Initializes the SuperFunctionCaller-pointer with zero.
Definition: Super.h:310
xmlelement
Definition: Super.h:519
static void superCheck()
Definition: Super.h:303
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Defines the helper function orxout() and includes all necessary headers to use the output system...
Deletes the SuperFunctionCaller.
Definition: Super.h:319
#define SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments,...)
Creates the needed objects and templates to call a super-function.
Definition: Super.h:334