Skip to content

Handle

Generated from engine/core/handle.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the core module

#include "engine/core/handle.h" · namespace labrador

class Handle

A name that has already been resolved.

Resource is never stored - it is a phantom, there so that a handle to a sprite frame cannot be passed where a handle to an animation strip belongs. Both are otherwise an int, and an int silently means whatever the callee thinks it means.

The index is into whichever table produced the handle and is meaningless against any other, so a handle travels with the table it came from. Tables resolve names into these once, at load; per-frame code only carries them (PHILOSOPHY T7, T8).

Handle() = default;

Unresolved. Reading through one is a throw, not a read of slot zero - the default has to be inert, because every draw object is default-constructible and would otherwise start life pointing at whatever happened to load first.

explicit Handle(int index);

Explicit, and only meaningful to the table that owns the slot. Callers get handles from resolve(), not from arithmetic.

bool valid() const;
int index() const;
friend bool operator==(Handle a, Handle b);
friend bool operator!=(Handle a, Handle b);

No sample or test includes this header directly.

Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.