Definition of all super-function related macros, used to call functions of the base class.
More...
|
#define | SUPER(classname, functionname, ...) SUPER_##functionname(classname, functionname, __VA_ARGS__) |
| SUPER-macro: Calls Parent::functionname(...) where Parent is the direct parent of classname. More...
|
|
#define | SUPER_ARGS(classname, functionname, ...) (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this, __VA_ARGS__) |
|
#define | SUPER_CALL_ARGUMENTS0(...) Identifiable* object |
|
#define | SUPER_CALL_ARGUMENTS1(...) Identifiable* object, __VA_ARGS__ |
|
#define | SUPER_CALL_ARGUMENTSfalse(...) Identifiable* object |
|
#define | SUPER_CALL_ARGUMENTStrue(...) Identifiable* object, __VA_ARGS__ |
|
#define | SUPER_changedActivity(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedCarrier(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedName(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedOverlayGroup(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedOwner(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedPickedUp(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedScale(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedUsed(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_changedVisibility(classname, functionname, ...) SUPER_NOARGS(classname, functionname) |
|
#define | SUPER_FUNCTION(functionnumber, baseclass, functionname, purevirtualbase) |
| Declares a new super-function by creating a specialized template. More...
|
|
#define | SUPER_FUNCTION_GLOBAL_DECLARATION_PART1(functionnumber, functionname, hasarguments, ...) |
| Creates the needed objects and templates to call a super-function. More...
|
|
#define | SUPER_FUNCTION_GLOBAL_DECLARATION_PART2 |
|
#define | SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND0(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass) |
|
#define | SUPER_FUNCTION_PUREVIRTUAL_WORKAROUND1(functionnumber, baseclass) SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) |
|
#define | SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDfalse(functionnumber, baseclass) |
|
#define | SUPER_FUNCTION_PUREVIRTUAL_WORKAROUNDtrue(functionnumber, baseclass) |
|
#define | SUPER_NOARGS(classname, functionname) (*ClassIdentifier<classname>::getIdentifier()->superFunctionCaller_##functionname##_)(this) |
|
#define | SUPER_tick(classname, functionname, ...) SUPER_ARGS(classname, functionname, __VA_ARGS__) |
|
#define | SUPER_XMLEventPort(classname, functionname, ...) SUPER_ARGS(classname, functionname, __VA_ARGS__) |
|
#define | SUPER_XMLPort(classname, functionname, ...) SUPER_ARGS(classname, functionname, __VA_ARGS__) |
|
Definition of all super-function related macros, used to call functions of the base class.
This file defines all macros needed to add a new "super-function". If you add a super-function, you can call SUPER(myclass, functionname, arguments)
inside your code and the function of the parent-class gets called. This is comparable to super.functionname(arguments)
in Java or other languages.
This works only with virtual functions that return nothing (void
) and belong to classes that have an Identifier. Arguments however are supported, there's no limitation for their number and type, except that the type has to be known in Super.h.
To add a new super-function, you have to process 4 steps:
- Add a new
SUPER
macro
This allows you to call the super-function in your code.
Location: This file (Super.h), marked with "--> HERE <--" comments (1/3)
- Call the
SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2
macros.
This defines some global classes and templates, needed to create and call the super-functions.
Location: This file (Super.h), marked with "--> HERE <--" comments (2/3)
- Call the
SUPER_INTRUSIVE_DECLARATION
macro.
This will be included into the declaration of ClassIdentifier<T>
.
Location: This file (Super.h), marked with "--> HERE <--" comments (3/3)
- Call the
SUPER_FUNCTION
macro.
This defines a partially specialized template that will decide if a class is "super" to another class. If the check returns true, a SuperFunctionCaller
gets created, which will be used by the SUPER
macro. You have to add this into the header-file of the baseclass of the super-function (the class that first implements the function), below the class declaration. You can't call it directly in this file, because otherwise you had to include the headerfile right here, which would cause some ugly back-dependencies, include loops and slower compilation.
Dont forget to include Super.h in the header-file.
Location: The header-file of the baseclass (Baseclass.h), below the class declaration