summaryrefslogtreecommitdiffstats
path: root/src/libs/client/Store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/client/Store.cpp')
-rw-r--r--src/libs/client/Store.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index 65b3080e..cd52af70 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -33,6 +33,7 @@ Store::Store(SigClientInterface& emitter)
emitter.new_patch_sig.connect(sigc::mem_fun(this, &Store::new_patch_event));
emitter.new_node_sig.connect(sigc::mem_fun(this, &Store::new_node_event));
emitter.new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event));
+ emitter.connection_sig.connect(sigc::mem_fun(this, &Store::connection_event));
emitter.metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event));
}
@@ -271,5 +272,22 @@ Store::metadata_update_event(const string& subject_path, const string& predicate
}
+void
+Store::connection_event(const string& src_port_path, const string& dst_port_path)
+{
+ const Path& src = src_port_path;
+ const Path& dst = dst_port_path;
+
+ assert(src.parent().parent() == dst.parent().parent());
+ const Path& patch_path = src.parent().parent();
+
+ CountedPtr<PatchModel> patch = this->patch(patch_path);
+ if (patch)
+ patch->add_connection(new ConnectionModel(src, dst));
+ else
+ cerr << "ERROR: connection in nonexistant patch" << endl;
+}
+
+
} // namespace LibOmClient