|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Typed, reference-counted UUID reference into an IObjectRegistry. More...
#include <src/utils/typed_uuid_reference.h>
Public Types | |
| using | UuidType = typename T::Uuid |
Public Member Functions | |
| TypedUuidReference (const UuidType &id, IObjectRegistry ®istry) | |
| TypedUuidReference (IObjectRegistry ®istry) | |
| TypedUuidReference (const TypedUuidReference &other)=default | |
| TypedUuidReference & | operator= (const TypedUuidReference &other)=default |
| TypedUuidReference (TypedUuidReference &&other) noexcept=default | |
| TypedUuidReference & | operator= (TypedUuidReference &&other) noexcept=default |
| template<UuidIdentifiable U> | |
| TypedUuidReference (const TypedUuidReference< U > &other) | |
| UuidType | id () const |
| void | set_id (const UuidType &id) |
| T * | get () const |
| template<typename DerivedT> | |
| DerivedT * | get_object_as () const |
| UuidIdentifiableBase * | get_object_base () const |
| T * | get_or_throw () const |
| bool | has_value () const |
| IObjectRegistry & | get_registry () const |
| const UuidReference & | as_untyped () const |
Friends | |
| void | to_json (nlohmann::json &j, const TypedUuidReference &ref) |
| void | from_json (const nlohmann::json &j, TypedUuidReference &ref) |
| auto | format_as (const TypedUuidReference &ref) |
Typed, reference-counted UUID reference into an IObjectRegistry.
Wraps UuidReference and adds type safety. Holds the typed UUID (typename T::Uuid) and resolves to T* via qobject_cast. Works for both base types (e.g., TypedUuidReference<Track>) and concrete derived types (e.g., TypedUuidReference<MidiTrack>) — the only difference is which qobject_cast is performed on lookup.
T must satisfy the UuidIdentifiable concept (i.e., inherit from a UuidIdentifiableObject for some U, and be a QObject).
Use as_untyped() to access the underlying UuidReference when the typed interface is not needed (e.g., for storage in heterogeneous containers).
Definition at line 29 of file typed_uuid_reference.h.
| using zrythm::utils::TypedUuidReference< T >::UuidType = typename T::Uuid |
Definition at line 32 of file typed_uuid_reference.h.
|
inline |
Definition at line 36 of file typed_uuid_reference.h.
|
inline |
Definition at line 41 of file typed_uuid_reference.h.
|
inline |
Definition at line 50 of file typed_uuid_reference.h.
|
inline |
Definition at line 89 of file typed_uuid_reference.h.
|
inline |
Definition at line 59 of file typed_uuid_reference.h.
|
inline |
Definition at line 67 of file typed_uuid_reference.h.
|
inline |
Definition at line 72 of file typed_uuid_reference.h.
|
inline |
Definition at line 74 of file typed_uuid_reference.h.
|
inline |
Definition at line 87 of file typed_uuid_reference.h.
|
inline |
Definition at line 85 of file typed_uuid_reference.h.
|
inline |
Definition at line 55 of file typed_uuid_reference.h.
|
inline |
Definition at line 57 of file typed_uuid_reference.h.
|
friend |
Definition at line 100 of file typed_uuid_reference.h.
|
friend |
Definition at line 95 of file typed_uuid_reference.h.
|
friend |
Definition at line 91 of file typed_uuid_reference.h.