aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/machina
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-14 03:28:12 +0000
committerDavid Robillard <d@drobilla.net>2007-02-14 03:28:12 +0000
commita532829cb5d19aa06ad7f52693e3db24f234741e (patch)
tree9eeac48c0f9e241d0ca7b613743eb02284f9bab6 /src/engine/machina
parenta795ba2553d1663bc29b8e8fa3186efb516f27d4 (diff)
downloadmachina-a532829cb5d19aa06ad7f52693e3db24f234741e.tar.gz
machina-a532829cb5d19aa06ad7f52693e3db24f234741e.tar.bz2
machina-a532829cb5d19aa06ad7f52693e3db24f234741e.zip
Serialization work on Machina.
git-svn-id: http://svn.drobilla.net/lad/machina@306 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/machina')
-rw-r--r--src/engine/machina/Machine.hpp5
-rw-r--r--src/engine/machina/Node.hpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp
index b53f55c..3e63530 100644
--- a/src/engine/machina/Machine.hpp
+++ b/src/engine/machina/Machine.hpp
@@ -20,6 +20,7 @@
#include <raul/SharedPtr.h>
#include <raul/List.h>
+#include <raul/RDFWriter.h>
#include "types.hpp"
#include "LearnRequest.hpp"
#include "Node.hpp"
@@ -27,7 +28,7 @@
namespace Machina {
-class Machine {
+class Machine : public Raul::Stateful {
public:
Machine();
~Machine();
@@ -42,6 +43,8 @@ public:
void add_node(SharedPtr<Node> node);
void learn(SharedPtr<LearnRequest> learn);
+ void write_state(Raul::RDFWriter& writer);
+
// Audio context
void reset();
FrameCount run(FrameCount nframes);
diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp
index 243773f..10d4ed4 100644
--- a/src/engine/machina/Node.hpp
+++ b/src/engine/machina/Node.hpp
@@ -21,6 +21,7 @@
#include <boost/utility.hpp>
#include <raul/SharedPtr.h>
#include <raul/List.h>
+#include <raul/Stateful.h>
#include "types.hpp"
#include "Action.hpp"
@@ -37,7 +38,7 @@ class Edge;
* Initial nodes do not have enter actions (since they are entered at
* an undefined point in time <= 0).
*/
-class Node : public boost::noncopyable {
+class Node : public Raul::Stateful, public boost::noncopyable {
public:
typedef std::string ID;
@@ -55,6 +56,8 @@ public:
void add_outgoing_edge(SharedPtr<Edge> edge);
void remove_outgoing_edge(SharedPtr<Edge> edge);
+ void write_state(Raul::RDFWriter& writer);
+
bool is_initial() const { return _is_initial; }
void set_initial(bool i) { _is_initial = i; }
bool is_active() const { return _is_active; }