Defines the Object structure and macros for method invocation in a class hierarchy.
More...
|
#define | SUPER(method_name, ...) call_method_0(classManager.methodsCorrespondance.method_name[classManager.extends[__type__]], this, ##__VA_ARGS__) |
| Invokes a method from the superclass.
|
|
#define | METHOD_TYPE(default_type, method_name, obj, ...) classManager.methodsCorrespondance.method_name[default_type], obj, ##__VA_ARGS__ |
| Invokes a method with a specified default type.
|
|
#define | METHOD(method_name, obj, ...) classManager.methodsCorrespondance.method_name[obj->type], obj, ##__VA_ARGS__ |
| Invokes a method on an object.
|
|
Defines the Object structure and macros for method invocation in a class hierarchy.
This file contains the definition of the Object structure and several macros to facilitate method invocation in a class hierarchy. The macros handle method lookup and invocation, including support for inheritance and method overriding.
◆ SUPER
#define SUPER |
( |
|
method_name, |
|
|
|
... |
|
) |
| call_method_0(classManager.methodsCorrespondance.method_name[classManager.extends[__type__]], this, ##__VA_ARGS__) |
Invokes a method from the superclass.
This macro is used to invoke a method from the superclass of the current object. It performs a lookup in the class hierarchy to find the appropriate method and invokes it with the provided arguments.
- Parameters
-
method_name | The name of the method to invoke. |
... | Additional arguments to pass to the method. |
◆ METHOD_TYPE
#define METHOD_TYPE |
( |
|
default_type, |
|
|
|
method_name, |
|
|
|
obj, |
|
|
|
... |
|
) |
| classManager.methodsCorrespondance.method_name[default_type], obj, ##__VA_ARGS__ |
Invokes a method with a specified default type.
This macro is used to invoke a method on an object with a specified default type. It performs a lookup in the class hierarchy to find the appropriate method and invokes it with the provided arguments.
- Parameters
-
default_type | The default type to use for method lookup. |
method_name | The name of the method to invoke. |
obj | The object on which to invoke the method. |
... | Additional arguments to pass to the method. |
◆ METHOD
#define METHOD |
( |
|
method_name, |
|
|
|
obj, |
|
|
|
... |
|
) |
| classManager.methodsCorrespondance.method_name[obj->type], obj, ##__VA_ARGS__ |
Invokes a method on an object.
This macro is used to invoke a method on an object. It uses the object's type to perform a lookup in the class hierarchy and find the appropriate method, then invokes it with the provided arguments.
- Parameters
-
method_name | The name of the method to invoke. |
obj | The object on which to invoke the method. |
... | Additional arguments to pass to the method. |
◆ call_method_0()
void call_method_0 |
( |
void(*)(void *, va_list) |
func, |
|
|
|
... |
|
) |
| |