Roy Want / Mbed OS beaconCompileReadyFork
Embed: (wiki syntax)

« Back to documentation index

ThunkVTable Struct Reference

ThunkVTable Struct Reference

This POD is used as a vtable by Thunk implementation. More...

#include <ThunkVTable.h>

Data Fields

void(*const destroy )(thunk_t &self)
 destroy a thunk (act like a destructor).
void(*const copy )(thunk_t &dest, const thunk_t &self)
 Copy self into dest.
void(*const call )(const thunk_t &self)
 Synthetized call for the inner object of the thunk_t.

Detailed Description

This POD is used as a vtable by Thunk implementation.

Thunk is a value type for all type nullary callable and therefore standard polymorphism is not suitable for that use case. Instead, the vtable is generated for each type contained in a thunk. This structure is the prototype of such vtable.

Note:
see ThunkVTableGenerator for implementation and the generation of Thunk vtables.

Definition at line 36 of file ThunkVTable.h.


Field Documentation

void(* const call)(const thunk_t &self)

Synthetized call for the inner object of the thunk_t.

Definition at line 53 of file ThunkVTable.h.

void(* const copy)(thunk_t &dest, const thunk_t &self)

Copy self into dest.

It is expected that dest is empty.

Definition at line 48 of file ThunkVTable.h.

void(* const destroy)(thunk_t &self)

destroy a thunk (act like a destructor).

Definition at line 42 of file ThunkVTable.h.