Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
A reference-counted RAII wrapper for a UUID in a registry. More...
#include <src/utils/uuid_identifiable_object.h>
Public Types | |
using | UuidType = typename RegistryT::UuidType |
using | VariantType = typename RegistryT::VariantType |
Public Member Functions | |
UuidReference (RegistryT ®istry) | |
UuidReference (const UuidType &id, RegistryT ®istry) | |
UuidReference (const UuidReference &other) | |
UuidReference & | operator= (const UuidReference &other) |
UuidReference (UuidReference &&other) | |
UuidReference & | operator= (UuidReference &&other) |
const UuidType & | id () const |
void | set_id (const UuidType &id) |
To be used when using the Registry-only constructor. | |
VariantType | get_object () const |
template<typename ObjectT> requires IsInVariant<ObjectT *, VariantType> | |
ObjectT * | get_object_as () const |
template<typename... Args> | |
UuidReference | clone_new_identity (Args &&... args) const |
auto | get_iterator_in_registry () const |
auto | get_iterator_in_registry () |
Static Public Attributes | |
static constexpr auto | kIdKey = "id"sv |
Friends | |
void | to_json (nlohmann::json &j, const UuidReference &ref) |
void | from_json (const nlohmann::json &j, UuidReference &ref) |
bool | operator== (const UuidReference &lhs, const UuidReference &rhs) |
A reference-counted RAII wrapper for a UUID in a registry.
Objects that refer to an object's UUID must use this wrapper.
TODO: actually use this
RegistryT |
Definition at line 130 of file uuid_identifiable_object.h.
using zrythm::utils::UuidReference< RegistryT >::UuidType = typename RegistryT::UuidType |
Definition at line 133 of file uuid_identifiable_object.h.
using zrythm::utils::UuidReference< RegistryT >::VariantType = typename RegistryT::VariantType |
Definition at line 134 of file uuid_identifiable_object.h.
|
inline |
Definition at line 139 of file uuid_identifiable_object.h.
|
inline |
Definition at line 141 of file uuid_identifiable_object.h.
|
inline |
Definition at line 147 of file uuid_identifiable_object.h.
|
inline |
Definition at line 166 of file uuid_identifiable_object.h.
|
inline |
Definition at line 190 of file uuid_identifiable_object.h.
|
inline |
Definition at line 226 of file uuid_identifiable_object.h.
|
inline |
Definition at line 240 of file uuid_identifiable_object.h.
|
inline |
Definition at line 235 of file uuid_identifiable_object.h.
|
inline |
Definition at line 212 of file uuid_identifiable_object.h.
|
inline |
Definition at line 219 of file uuid_identifiable_object.h.
|
inline |
Definition at line 192 of file uuid_identifiable_object.h.
|
inline |
Definition at line 155 of file uuid_identifiable_object.h.
|
inline |
Definition at line 174 of file uuid_identifiable_object.h.
|
inline |
To be used when using the Registry-only constructor.
This is useful when deserializing UuidReference types: First construct with just the registry, then from_json() should call this to set the ID and acquire a reference.
Definition at line 201 of file uuid_identifiable_object.h.
|
friend |
Definition at line 271 of file uuid_identifiable_object.h.
|
friend |
Definition at line 279 of file uuid_identifiable_object.h.
|
friend |
Definition at line 266 of file uuid_identifiable_object.h.
|
staticconstexpr |
Definition at line 136 of file uuid_identifiable_object.h.