From fa6bb9afe8fcf2b0b8348495b9c4e1d6425136f0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Feb 2017 23:18:59 +0100 Subject: Move Properties out of Resource --- src/server/events/Connect.hpp | 8 ++++---- src/server/events/CreateBlock.cpp | 16 ++++++++-------- src/server/events/CreateBlock.hpp | 24 ++++++++++++------------ src/server/events/CreateGraph.cpp | 24 ++++++++++++------------ src/server/events/CreateGraph.hpp | 26 +++++++++++++------------- src/server/events/CreatePort.cpp | 18 +++++++++--------- src/server/events/CreatePort.hpp | 32 ++++++++++++++++---------------- src/server/events/Delta.cpp | 8 +++----- src/server/events/Delta.hpp | 26 +++++++++++++------------- 9 files changed, 90 insertions(+), 92 deletions(-) (limited to 'src/server/events') diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 8e7a5030..78c0befa 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -64,10 +64,10 @@ private: MPtr _compiled_graph; SPtr _arc; MPtr _voices; - Resource::Properties _tail_remove; - Resource::Properties _tail_add; - Resource::Properties _head_remove; - Resource::Properties _head_add; + Properties _tail_remove; + Properties _tail_add; + Properties _head_remove; + Properties _head_add; }; } // namespace Events diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index db561e1c..0b4cbae3 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -35,12 +35,12 @@ namespace Ingen { namespace Server { namespace Events { -CreateBlock::CreateBlock(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - Resource::Properties& properties) +CreateBlock::CreateBlock(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) @@ -55,7 +55,7 @@ CreateBlock::~CreateBlock() bool CreateBlock::pre_process(PreProcessContext& ctx) { - typedef Resource::Properties::const_iterator iterator; + typedef Properties::const_iterator iterator; const Ingen::URIs& uris = _engine.world()->uris(); const SPtr store = _engine.store(); @@ -121,7 +121,7 @@ CreateBlock::pre_process(PreProcessContext& ctx) // Load state from directory if given in properties LilvState* state = NULL; - Resource::Properties::iterator s = _properties.find(uris.state_state); + Properties::iterator s = _properties.find(uris.state_state); if (s != _properties.end() && s->second.type() == uris.forge.Path) { state = LV2Block::load_state(_engine.world(), s->second.ptr()); } diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index 047c01f3..7ffd9931 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -38,12 +38,12 @@ namespace Events { class CreateBlock : public Event { public: - CreateBlock(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& block_path, - Resource::Properties& properties); + CreateBlock(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& block_path, + Properties& properties); ~CreateBlock(); @@ -53,12 +53,12 @@ public: void undo(Interface& target); private: - Raul::Path _path; - Resource::Properties& _properties; - ClientUpdate _update; - GraphImpl* _graph; - BlockImpl* _block; - MPtr _compiled_graph; + Raul::Path _path; + Properties& _properties; + ClientUpdate _update; + GraphImpl* _graph; + BlockImpl* _block; + MPtr _compiled_graph; }; } // namespace Events diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 1fff9f95..891ca33c 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -31,12 +31,12 @@ namespace Ingen { namespace Server { namespace Events { -CreateGraph::CreateGraph(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties) +CreateGraph::CreateGraph(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) @@ -57,7 +57,7 @@ CreateGraph::build_child_events() const Ingen::URIs& uris = _engine.world()->uris(); // Properties common to both ports - Resource::Properties control_properties; + Properties control_properties; control_properties.put(uris.atom_bufferType, uris.atom_Sequence); control_properties.put(uris.atom_supports, uris.patch_Message); control_properties.put(uris.lv2_designation, uris.lv2_control); @@ -66,7 +66,7 @@ CreateGraph::build_child_events() control_properties.put(uris.rsz_minimumSize, uris.forge.make(4096)); // Add control port (message receive) - Resource::Properties in_properties(control_properties); + Properties in_properties(control_properties); in_properties.put(uris.lv2_index, uris.forge.make(0)); in_properties.put(uris.lv2_name, uris.forge.alloc("Control")); in_properties.put(uris.rdf_type, uris.lv2_InputPort); @@ -82,7 +82,7 @@ CreateGraph::build_child_events() in_properties)); // Add notify port (message respond) - Resource::Properties out_properties(control_properties); + Properties out_properties(control_properties); out_properties.put(uris.lv2_index, uris.forge.make(1)); out_properties.put(uris.lv2_name, uris.forge.alloc("Notify")); out_properties.put(uris.rdf_type, uris.lv2_OutputPort); @@ -113,7 +113,7 @@ CreateGraph::pre_process(PreProcessContext& ctx) const Ingen::URIs& uris = _engine.world()->uris(); - typedef Resource::Properties::const_iterator iterator; + typedef Properties::const_iterator iterator; uint32_t ext_poly = 1; uint32_t int_poly = 1; @@ -158,8 +158,8 @@ CreateGraph::pre_process(PreProcessContext& ctx) _engine.driver()->sample_rate(), int_poly); _graph->add_property(uris.rdf_type, uris.ingen_Graph.urid); _graph->add_property(uris.rdf_type, - Resource::Property(uris.ingen_Block, - Resource::Graph::EXTERNAL)); + Property(uris.ingen_Block, + Resource::Graph::EXTERNAL)); } _graph->set_properties(_properties); diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 896a18f9..9b4124e4 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -37,12 +37,12 @@ namespace Events { class CreateGraph : public Event { public: - CreateGraph(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties); + CreateGraph(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); ~CreateGraph(); @@ -56,13 +56,13 @@ public: private: void build_child_events(); - const Raul::Path _path; - Resource::Properties _properties; - ClientUpdate _update; - GraphImpl* _graph; - GraphImpl* _parent; - MPtr _compiled_graph; - std::list _child_events; + const Raul::Path _path; + Properties _properties; + ClientUpdate _update; + GraphImpl* _graph; + GraphImpl* _parent; + MPtr _compiled_graph; + std::list _child_events; }; } // namespace Events diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 63301efd..4e34762a 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -36,12 +36,12 @@ namespace Ingen { namespace Server { namespace Events { -CreatePort::CreatePort(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties) +CreatePort::CreatePort(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _port_type(PortType::UNKNOWN) @@ -53,8 +53,8 @@ CreatePort::CreatePort(Engine& engine, { const Ingen::URIs& uris = _engine.world()->uris(); - typedef Resource::Properties::const_iterator Iterator; - typedef std::pair Range; + typedef Properties::const_iterator Iterator; + typedef std::pair Range; const Range types = properties.equal_range(uris.rdf_type); for (Iterator i = types.first; i != types.second; ++i) { @@ -109,7 +109,7 @@ CreatePort::pre_process(PreProcessContext& ctx) const uint32_t buf_size = bufs.default_size(_buf_type); const int32_t old_n_ports = _graph->num_ports_non_rt(); - typedef Resource::Properties::const_iterator PropIter; + typedef Properties::const_iterator PropIter; PropIter index_i = _properties.find(uris.lv2_index); if (index_i == _properties.end()) { diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index 2d32f1dd..a2ea7682 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -45,12 +45,12 @@ namespace Events { class CreatePort : public Event { public: - CreatePort(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties); + CreatePort(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); bool pre_process(PreProcessContext& ctx); void execute(RunContext& context); @@ -63,16 +63,16 @@ private: OUTPUT }; - Raul::Path _path; - PortType _port_type; - LV2_URID _buf_type; - GraphImpl* _graph; - DuplexPort* _graph_port; - MPtr _ports_array; ///< New external port array for Graph - EnginePort* _engine_port; ///< Driver port if on the root - Resource::Properties _properties; - Resource::Properties _update; - boost::optional _flow; + Raul::Path _path; + PortType _port_type; + LV2_URID _buf_type; + GraphImpl* _graph; + DuplexPort* _graph_port; + MPtr _ports_array; ///< New external port array for Graph + EnginePort* _engine_port; ///< Driver port if on the root + Properties _properties; + Properties _update; + boost::optional _flow; }; } // namespace Events diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 0398face..9f4c1da2 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -42,8 +42,6 @@ namespace Ingen { namespace Server { namespace Events { -typedef Resource::Properties Properties; - Delta::Delta(Engine& engine, SPtr client, int32_t id, @@ -276,9 +274,9 @@ Delta::pre_process(PreProcessContext& ctx) } for (const auto& p : _properties) { - const Raul::URI& key = p.first; - const Resource::Property& value = p.second; - SpecialType op = SpecialType::NONE; + const Raul::URI& key = p.first; + const Property& value = p.second; + SpecialType op = SpecialType::NONE; if (obj) { Resource& resource = *obj; if (value != uris.patch_wildcard) { diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index d751afc7..842986a9 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -56,15 +56,15 @@ public: PATCH }; - Delta(Engine& engine, - SPtr client, - int32_t id, - SampleCount timestamp, - Type type, - Resource::Graph context, - const Raul::URI& subject, - const Resource::Properties& properties, - const Resource::Properties& remove = Resource::Properties()); + Delta(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + Type type, + Resource::Graph context, + const Raul::URI& subject, + const Properties& properties, + const Properties& remove = Properties()); ~Delta(); @@ -99,8 +99,8 @@ private: std::vector _types; std::vector _remove_types; Raul::URI _subject; - Resource::Properties _properties; - Resource::Properties _remove; + Properties _properties; + Properties _remove; ClientUpdate _update; Ingen::Resource* _object; GraphImpl* _graph; @@ -110,8 +110,8 @@ private: Resource::Graph _context; Type _type; - Resource::Properties _added; - Resource::Properties _removed; + Properties _added; + Properties _removed; std::vector _removed_bindings; -- cgit v1.2.1