diff options
author | David Robillard <d@drobilla.net> | 2014-03-29 22:02:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-03-29 22:02:13 +0000 |
commit | 8d3e4718aa1fe278b6f696dd3d91275d8f4ff5b2 (patch) | |
tree | c166c8f8a0b5dbd26a20bc3f7426b1dfded25627 /src/server/events/Get.hpp | |
parent | 2f18f7f73da0d4592135ce383be9156bca8acb5f (diff) | |
download | ingen-8d3e4718aa1fe278b6f696dd3d91275d8f4ff5b2.tar.gz ingen-8d3e4718aa1fe278b6f696dd3d91275d8f4ff5b2.tar.bz2 ingen-8d3e4718aa1fe278b6f696dd3d91275d8f4ff5b2.zip |
Eliminate long-term lock from Get event.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5344 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/Get.hpp')
-rw-r--r-- | src/server/events/Get.hpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/src/server/events/Get.hpp b/src/server/events/Get.hpp index 7a5830a3..7aea8c77 100644 --- a/src/server/events/Get.hpp +++ b/src/server/events/Get.hpp @@ -17,8 +17,6 @@ #ifndef INGEN_EVENTS_GET_HPP #define INGEN_EVENTS_GET_HPP -#include <glibmm/thread.h> - #include "Event.hpp" #include "BlockFactory.hpp" #include "types.hpp" @@ -48,11 +46,44 @@ public: void post_process(); private: - const Raul::URI _uri; - const Node* _object; - const PluginImpl* _plugin; - BlockFactory::Plugins _plugins; - Glib::RWLock::ReaderLock _lock; + /** A sequence of puts and connects to respond to client with. + * This is constructed in the pre_process() and later sent in + * post_process() to avoid the need to lock. + * + * Ideally events (both server and client) would always be in a standard + * message format so the Ingen protocol went the whole way through the + * system, but for now things are controlled procedurally through + * Interface, so this interim structure is necessary. + */ + struct Response { + void put(const Raul::URI& uri, + const Resource::Properties& props, + Resource::Graph ctx=Resource::Graph::DEFAULT); + + void put_port(const PortImpl* port); + void put_block(const BlockImpl* block); + void put_graph(const GraphImpl* graph); + + struct Put { + Raul::URI uri; + Resource::Properties properties; + Resource::Graph ctx; + }; + + struct Connect { + Raul::Path tail; + Raul::Path head; + }; + + std::vector<Put> puts; + std::vector<Connect> connects; + }; + + const Raul::URI _uri; + const Node* _object; + const PluginImpl* _plugin; + BlockFactory::Plugins _plugins; + Response _response; }; } // namespace Events |