summaryrefslogtreecommitdiff
path: root/lib/hier_block.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-23 11:03:10 -0400
committerJosh Blum2012-09-23 11:03:10 -0400
commit37d94b9717b11aea0f26905857bf3676589d43e9 (patch)
tree2177136efeaa35f0932efb1e9a3036b2ca255d49 /lib/hier_block.cpp
parentf39fe9d7f1bdee682ac75dec3c3774d1f096f55f (diff)
downloadsandhi-37d94b9717b11aea0f26905857bf3676589d43e9.tar.gz
sandhi-37d94b9717b11aea0f26905857bf3676589d43e9.tar.bz2
sandhi-37d94b9717b11aea0f26905857bf3676589d43e9.zip
store the container sptr in tsbe topology
Diffstat (limited to 'lib/hier_block.cpp')
-rw-r--r--lib/hier_block.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/hier_block.cpp b/lib/hier_block.cpp
index 860ac25..d4c9ee6 100644
--- a/lib/hier_block.cpp
+++ b/lib/hier_block.cpp
@@ -35,19 +35,16 @@ HierBlock::HierBlock(const std::string &name):
void ElementImpl::hier_block_cleanup(void)
{
this->topology.clear_all();
- this->children.clear();
}
void HierBlock::connect(const Element &elem)
{
(*this)->topology.add_topology(elem->topology);
- (*this)->children.push_back(elem.weak_self.lock());
}
void HierBlock::disconnect(const Element &elem)
{
(*this)->topology.remove_topology(elem->topology);
- remove_one((*this)->children, elem.weak_self.lock());
}
void HierBlock::connect(
@@ -58,12 +55,10 @@ void HierBlock::connect(
){
//TODO, this is the perfect place to validate IO sigs
const tsbe::Connection conn(
- tsbe::Port(src->get_elem(), src_index),
- tsbe::Port(sink->get_elem(), sink_index)
+ tsbe::Port(src->get_elem(), src_index, src.weak_self.lock()),
+ tsbe::Port(sink->get_elem(), sink_index, sink.weak_self.lock())
);
(*this)->topology.connect(conn);
- (*this)->children.push_back(src.weak_self.lock());
- (*this)->children.push_back(sink.weak_self.lock());
}
void HierBlock::disconnect(
@@ -77,16 +72,9 @@ void HierBlock::disconnect(
tsbe::Port(sink->get_elem(), sink_index)
);
(*this)->topology.disconnect(conn);
- remove_one((*this)->children, src.weak_self.lock());
- remove_one((*this)->children, sink.weak_self.lock());
}
void HierBlock::disconnect_all(void)
{
(*this)->topology.clear_all();
- (*this)->children.clear();
- if ((*this)->executor)
- {
- (*this)->executor.commit();
- }
}