From 381c4a77fe5864cd3aed3854b75acf2a52f6a74d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Jul 2020 16:01:07 +0200 Subject: Add explicit accessors to Quark --- ingen/URIs.hpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'ingen/URIs.hpp') diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp index eb657473..9d4b2818 100644 --- a/ingen/URIs.hpp +++ b/ingen/URIs.hpp @@ -51,13 +51,20 @@ public: ~Quark(); - operator LV2_URID() const { return urid.get(); } - explicit operator Atom() const { return urid; } - operator const LilvNode*() const { return lnode; } + const Atom& urid_atom() const { return _urid_atom; } + const Atom& uri_atom() const { return _uri_atom; } - Atom urid; - Atom uri; - LilvNode* lnode; + LV2_URID urid() const { return _urid_atom.get(); } + const LilvNode* node() const { return _lilv_node; } + + operator LV2_URID() const { return _urid_atom.get(); } + explicit operator Atom() const { return _urid_atom; } + operator const LilvNode*() const { return _lilv_node; } + + private: + Atom _urid_atom; + Atom _uri_atom; + LilvNode* _lilv_node; }; ingen::Forge& forge; @@ -203,10 +210,10 @@ public: inline bool operator==(const URIs::Quark& lhs, const Atom& rhs) { - if (rhs.type() == lhs.urid.type()) { - return rhs == lhs.urid; - } else if (rhs.type() == lhs.uri.type()) { - return rhs == lhs.uri; + if (rhs.type() == lhs.urid_atom().type()) { + return rhs == lhs.urid_atom(); + } else if (rhs.type() == lhs.uri_atom().type()) { + return rhs == lhs.uri_atom(); } return false; } -- cgit v1.2.1