diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/Node.cpp | 15 | ||||
-rw-r--r-- | src/engine/machina/Node.hpp | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/Node.cpp b/src/engine/Node.cpp index a7aa453..224718e 100644 --- a/src/engine/Node.cpp +++ b/src/engine/Node.cpp @@ -101,6 +101,21 @@ Node::remove_outgoing_edge(SharedPtr<Edge> edge) void +Node::remove_outgoing_edges_to(SharedPtr<Node> node) +{ + for (EdgeList::iterator i = _outgoing_edges.begin(); i != _outgoing_edges.end() ; ) { + EdgeList::iterator next = i; + ++next; + + if ((*i)->dst() == node) + _outgoing_edges.erase(i); + + i = next; + } +} + + +void Node::write_state(Raul::RDFWriter& writer) { using Raul::RdfId; diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp index c4d9dee..7573e39 100644 --- a/src/engine/machina/Node.hpp +++ b/src/engine/machina/Node.hpp @@ -57,6 +57,7 @@ public: void add_outgoing_edge(SharedPtr<Edge> edge); void remove_outgoing_edge(SharedPtr<Edge> edge); + void remove_outgoing_edges_to(SharedPtr<Node> node); void write_state(Raul::RDFWriter& writer); |