Halide
|
#include <ObjectInstanceRegistry.h>
Public Types | |
enum | Kind { Invalid, Generator, GeneratorParam, GeneratorInput, GeneratorOutput, FilterParam } |
Public Member Functions | |
ObjectInstanceRegistry (const ObjectInstanceRegistry &)=delete | |
ObjectInstanceRegistry & | operator= (const ObjectInstanceRegistry &)=delete |
ObjectInstanceRegistry (ObjectInstanceRegistry &&)=delete | |
ObjectInstanceRegistry & | operator= (ObjectInstanceRegistry &&)=delete |
Static Public Member Functions | |
static void | register_instance (void *this_ptr, size_t size, Kind kind, void *subject_ptr, const void *introspection_helper) |
Add an instance to the registry. More... | |
static void | unregister_instance (void *this_ptr) |
Remove an instance from the registry. More... | |
static std::vector< void * > | instances_in_range (void *start, size_t size, Kind kind) |
Returns the list of subject pointers for objects that have been directly registered within the given range. More... | |
Definition at line 21 of file ObjectInstanceRegistry.h.
Enumerator | |
---|---|
Invalid | |
Generator | |
GeneratorParam | |
GeneratorInput | |
GeneratorOutput | |
FilterParam |
Definition at line 23 of file ObjectInstanceRegistry.h.
|
delete |
|
delete |
|
static |
Add an instance to the registry.
The size may be 0 for Param Kinds, but not for Generator. subject_ptr is the value actually associated with this instance; it is usually (but not necessarily) the same as this_ptr. Assert if this_ptr is already registered.
If 'this' is directly heap allocated (not a member of a heap-allocated object) and you want the introspection subsystem to know about it and its members, set the introspection_helper argument to a pointer to a global variable with the same true type as 'this'. For example:
MyObject *obj = new MyObject; static MyObject *introspection_helper = nullptr; register_instance(obj, sizeof(MyObject), kind, obj, &introspection_helper);
I.e. introspection_helper should be a pointer to a pointer to an object instance. The inner pointer can be null. The introspection subsystem will then assume this new object is of the matching type, which will help its members deduce their names on construction.
|
static |
Remove an instance from the registry.
Assert if not found.
|
static |
Returns the list of subject pointers for objects that have been directly registered within the given range.
If there is another containing object inside the range, instances within that object are skipped.
|
delete |
|
delete |