From a532829cb5d19aa06ad7f52693e3db24f234741e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Feb 2007 03:28:12 +0000 Subject: Serialization work on Machina. git-svn-id: http://svn.drobilla.net/lad/machina@306 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/machina/Machine.hpp | 5 ++++- src/engine/machina/Node.hpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/engine/machina') 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 #include +#include #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); void learn(SharedPtr 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 #include #include +#include #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); void remove_outgoing_edge(SharedPtr 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; } -- cgit v1.2.1