DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
ReflectionAbi.h File Reference

Classes

struct  DekiReflectionAbi
 Layout fingerprint of the structs that cross DLL boundaries. More...

Macros

#define DEKI_REFLECTION_ABI_EXPORT_NAME   "DekiPluginGetReflectionAbi"

Typedefs

typedef const DekiReflectionAbi *(*) DekiGetReflectionAbiFunc()

Functions

DekiReflectionAbi DekiCurrentReflectionAbi ()
 The values as compiled into whoever calls this.
bool DekiReflectionAbiMatches (const DekiReflectionAbi &other, char *what, size_t whatSize)
 True when a loaded DLL's values match ours and it is safe to use.

Variables

constexpr uint32_t kDekiReflectionAbiVersion = 21
 Bump this for any binary change the sizes above cannot see, so packages built before it are refused at load ("rebuild it") instead of misbehaving:

Macro Definition Documentation

◆ DEKI_REFLECTION_ABI_EXPORT_NAME

#define DEKI_REFLECTION_ABI_EXPORT_NAME   "DekiPluginGetReflectionAbi"

Typedef Documentation

◆ DekiGetReflectionAbiFunc

typedef const DekiReflectionAbi *(*) DekiGetReflectionAbiFunc()

Function Documentation

◆ DekiCurrentReflectionAbi()

DekiReflectionAbi DekiCurrentReflectionAbi ( )
inline

The values as compiled into whoever calls this.

◆ DekiReflectionAbiMatches()

bool DekiReflectionAbiMatches ( const DekiReflectionAbi & other,
char * what,
size_t whatSize )
inline

True when a loaded DLL's values match ours and it is safe to use.

Otherwise what receives a description of the first mismatch, for the log.

Variable Documentation

◆ kDekiReflectionAbiVersion

uint32_t kDekiReflectionAbiVersion = 21
inlineconstexpr

Bump this for any binary change the sizes above cannot see, so packages built before it are refused at load ("rebuild it") instead of misbehaving:

  • a field reordered or repurposed without a size change;
  • a virtual added, removed or reordered on an engine class that packages derive from or call (Deki::Component, IMemoryProvider, IDisplay, ICamera, IRenderSystem, ...), since every later vtable slot moves;
  • a changed signature or name of anything packages link to or look up by name, since its mangled or exported name changes;
  • a change to DekiReflectionAbi itself. version stays at offset 0, and the loader must check it through the pointer before copying the struct, because an older DLL returns a shorter one. A size change alone (such as a field added to Deki::PropertyInfo) needs no bump: the sizeof fields catch it.

Debug and release builds may differ in layout (AllocContext carries file, function and line only with DEKI_ALLOC_CONTEXT_CAPTURE), so a debug engine with release packages is not supported.