Class ReferenceManager

Class Documentation

class ReferenceManager

Public Functions

~ReferenceManager()
void register_reference(const StringId &id, void *reference)

Registers a new reference for the reference counting

Note

we are using void* here because ResourceReference is a template function, and we don’t need to access it directly from the registry

Parameters:
  • id – the handle to the resource in the registry

  • reference – a void* pointer to the reference.

void unregister_reference(const StringId &id, void *reference)

Removes a reference from the reference counting

Parameters:
  • id – the handle to the resource in the registry

  • reference – a void* pointer to the reference.

void move_reference(const StringId &id, void *old_ref, void *new_ref)

Switches between two references in the reference counting, the same as calling unregister(old) register(new) but makes sure that there is always a valid reference (used in the ResourceReference move operators)

Parameters:
  • id – The resource handle

  • old_ref – The old reference (as a void*)

  • new_ref – The new reference (as a void*)