summaryrefslogtreecommitdiffstats
path: root/src/libs/shared/Store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/shared/Store.cpp')
-rw-r--r--src/libs/shared/Store.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libs/shared/Store.cpp b/src/libs/shared/Store.cpp
index 88fb9cb8..f77be312 100644
--- a/src/libs/shared/Store.cpp
+++ b/src/libs/shared/Store.cpp
@@ -17,6 +17,8 @@
#include <raul/PathTable.hpp>
#include <raul/TableImpl.hpp>
+#include "common/interface/Node.hpp"
+#include "common/interface/Port.hpp"
#include "Store.hpp"
using namespace std;
@@ -26,6 +28,25 @@ namespace Ingen {
namespace Shared {
+void
+Store::add(GraphObject* o)
+{
+ if (find(o->path()) != end()) {
+ cerr << "[Store] ERROR: Attempt to add duplicate object " << o->path() << endl;
+ return;
+ }
+
+ insert(make_pair(o->path(), o));
+
+ Node* node = dynamic_cast<Node*>(o);
+ if (node) {
+ for (uint32_t i=0; i < node->num_ports(); ++i) {
+ add(node->port(i));
+ }
+ }
+}
+
+
Store::const_iterator
Store::children_begin(SharedPtr<Shared::GraphObject> o) const
{