Trade-offs and warnings
Consult the linked header for this operation’s ownership, lifetime and failure behavior.
EPOK RUNTIME
Method · 1 overload
Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.
Adopt storage owned by somebody else (an actor's embedded default component, the Level itself).
ObjectId adopt(Object& instance, const ClassDescriptor& type)Adopt storage owned by somebody else (an actor's embedded default component, the Level itself).
| Parameter | Type | Meaning |
|---|---|---|
instance | Object & | Not documented; consult the linked header. |
type | const ClassDescriptor & | Not documented; consult the linked header. |
Returns: ObjectId. Consult the linked header for its meaning.
#include "object_model.hpp"
// Assume these named values have been initialized with valid data:
// Object & instance
// const ClassDescriptor & type
epok::ObjectRegistry& object = /* obtain a valid instance */;
auto result = object.adopt(instance, type);Consult the linked header for this operation’s ownership, lifetime and failure behavior.
Declared in runtime/object_model.hpp:412
acquirePool-backed construction of a concrete class.Methodclass_ofPerforms `class of` as part of the object model module.Methodcollect_quarantinedRetry the quarantined slots.Methodfinish_releaseCalled when the last dispatch scope unwinds: no callback can still be on the stack of a destroyed object, so its typed storage returns to the pool.MethodgetReturns get as part of the object model module.MethodlivePerforms `live` as part of the object model module.Methodnext_generationPerforms `next generation` as part of the object model module.MethodObjectRegistryConstructs `epok::ObjectRegistry` for the object model module.constructoroperator=Performs `operator =` as part of the object model module.MethodreleaseInvalidates the handle immediately; storage is quarantined while callbacks run.MethodresolveGeneration and class checked; the runtime class must derive from T's static class.Function templateslotPerforms `slot` as part of the object model module.Method