diff options
author | David Robillard <d@drobilla.net> | 2010-12-22 02:16:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-22 02:16:39 +0000 |
commit | 731274226c322192ccec35fb893f594e9bd69a88 (patch) | |
tree | 044e35fd4897fd6a0f7987a71c9fbe3adc3bc00e /src/engine/machina/Stateful.hpp | |
parent | 3d68bae339ee6f1285fc66d8192ea704708847f7 (diff) | |
download | machina-731274226c322192ccec35fb893f594e9bd69a88.tar.gz machina-731274226c322192ccec35fb893f594e9bd69a88.tar.bz2 machina-731274226c322192ccec35fb893f594e9bd69a88.zip |
Assign all objects a numeric ID at creation time.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2778 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/machina/Stateful.hpp')
-rw-r--r-- | src/engine/machina/Stateful.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/engine/machina/Stateful.hpp b/src/engine/machina/Stateful.hpp index 1a72db5..8dbf23d 100644 --- a/src/engine/machina/Stateful.hpp +++ b/src/engine/machina/Stateful.hpp @@ -18,21 +18,28 @@ #ifndef MACHINA_STATEFUL_HPP #define MACHINA_STATEFUL_HPP +#include <stdint.h> + +#include "redlandmm/World.hpp" #include "redlandmm/Model.hpp" namespace Machina { class Stateful { public: + Stateful(); + virtual ~Stateful() {} virtual void write_state(Redland::Model& model) = 0; - Redland::Node id() const { return _id; } - void set_id(const Redland::Node& id) { _id = id; } + Redland::Node id(Redland::World& world) const; + +private: + static uint64_t _next_id; -protected: - Redland::Node _id; + uint64_t _id; + mutable Redland::Node _rdf_id; }; } // namespace Machina |