Lumiera  0.pre.03
»edit your freedom«
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
vcall.h File Reference

Go to the source code of this file.

Description

This allows one to do polymorphic programming in C by referencing a vtable member which contains function pointers to a structure and then calling this 'virtual' functions through the VCALL macro.

Definition in file vcall.h.

#include <nobug.h>

Macros

#define LUMIERA_VCALL(self, function, ...)
 helper macro for calling vtable functions just adds syntacic sugar VCALL(obj, func, params...) translates to obj->vtable->func(obj, params...) plus some saftey checks More...
 
#define VCALL   LUMIERA_VCALL
 

Macro Definition Documentation

◆ LUMIERA_VCALL

#define LUMIERA_VCALL (   self,
  function,
  ... 
)
Value:
({ \
REQUIRE (self); \
REQUIRE (self->vtable->function); \
self->vtable->function (self, ## __VA_ARGS__); \
})

helper macro for calling vtable functions just adds syntacic sugar VCALL(obj, func, params...) translates to obj->vtable->func(obj, params...) plus some saftey checks

Definition at line 34 of file vcall.h.