summaryrefslogtreecommitdiffstats
path: root/ingen/Interface.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-16 04:13:23 +0000
committerDavid Robillard <d@drobilla.net>2012-03-16 04:13:23 +0000
commit9da093217352daa1fb61a6f2daf5195640e286a7 (patch)
treefb3489c04451dc14a61170ba2418123727414340 /ingen/Interface.hpp
parent119468f621a59d86da10bedf75c4427b70f9d370 (diff)
downloadingen-9da093217352daa1fb61a6f2daf5195640e286a7.tar.gz
ingen-9da093217352daa1fb61a6f2daf5195640e286a7.tar.bz2
ingen-9da093217352daa1fb61a6f2daf5195640e286a7.zip
Merge ClientInterface and ServerInterface.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4067 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ingen/Interface.hpp')
-rw-r--r--ingen/Interface.hpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp
new file mode 100644
index 00000000..cdc37949
--- /dev/null
+++ b/ingen/Interface.hpp
@@ -0,0 +1,91 @@
+/* This file is part of Ingen.
+ * Copyright 2008-2012 David Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef INGEN_INTERFACE_HPP
+#define INGEN_INTERFACE_HPP
+
+#include "ingen/Resource.hpp"
+#include "ingen/Status.hpp"
+
+namespace Raul { class Atom; class Path; class URI; }
+
+namespace Ingen {
+
+/** Abstract interface common to both engine and clients.
+ * Purely virtual (except for the destructor).
+ *
+ * \ingroup interface
+ */
+class Interface
+{
+public:
+ virtual ~Interface() {}
+
+ virtual Raul::URI uri() const = 0;
+
+ /** Begin an atomic bundle */
+ virtual void bundle_begin() = 0;
+
+ /** End (and send) an atomic bundle */
+ virtual void bundle_end() = 0;
+
+ virtual void put(const Raul::URI& uri,
+ const Resource::Properties& properties,
+ Resource::Graph ctx=Resource::DEFAULT) = 0;
+
+ virtual void delta(const Raul::URI& uri,
+ const Resource::Properties& remove,
+ const Resource::Properties& add) = 0;
+
+ virtual void move(const Raul::Path& old_path,
+ const Raul::Path& new_path) = 0;
+
+ virtual void del(const Raul::URI& uri) = 0;
+
+ virtual void connect(const Raul::Path& src_port_path,
+ const Raul::Path& dst_port_path) = 0;
+
+ virtual void disconnect(const Raul::URI& src,
+ const Raul::URI& dst) = 0;
+
+ virtual void disconnect_all(const Raul::Path& parent_patch_path,
+ const Raul::Path& path) = 0;
+
+ virtual void set_property(const Raul::URI& subject,
+ const Raul::URI& predicate,
+ const Raul::Atom& value) = 0;
+
+ /** Set the ID to use to respond to the next message.
+ * Setting the ID to -1 will disable responses.
+ */
+ virtual void set_response_id(int32_t id) = 0;
+
+ // Requests
+ virtual void ping() = 0;
+ virtual void get(const Raul::URI& uri) = 0;
+
+ // Response
+ virtual void response(int32_t id, Status status) = 0;
+
+ // Non-response error
+ virtual void error(const std::string& msg) = 0;
+};
+
+} // namespace Ingen
+
+#endif // INGEN_INTERFACE_HPP
+