Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50099 - in sandbox/dataflow-rewrite: boost/dataflow/blueprint boost/dataflow/managed libs/dataflow/src/managed
From: stipe_at_[hidden]
Date: 2008-12-03 16:53:03


Author: srajko
Date: 2008-12-03 16:53:02 EST (Wed, 03 Dec 2008)
New Revision: 50099
URL: http://svn.boost.org/trac/boost/changeset/50099

Log:
managed components unregister themselves on destruction, and blueprint::framework_entity_adapter allows copy construction of held entities
Text files modified:
   sandbox/dataflow-rewrite/boost/dataflow/blueprint/framework_entity_adapter.hpp | 7 ++++++-
   sandbox/dataflow-rewrite/boost/dataflow/managed/component.hpp | 2 +-
   sandbox/dataflow-rewrite/boost/dataflow/managed/network.hpp | 7 +++++++
   sandbox/dataflow-rewrite/libs/dataflow/src/managed/component.cpp | 6 ++++++
   4 files changed, 20 insertions(+), 2 deletions(-)

Modified: sandbox/dataflow-rewrite/boost/dataflow/blueprint/framework_entity_adapter.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/blueprint/framework_entity_adapter.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/blueprint/framework_entity_adapter.hpp 2008-12-03 16:53:02 EST (Wed, 03 Dec 2008)
@@ -69,11 +69,16 @@
     template<typename T>
     framework_entity_adapter(framework_context<BlueprintFramework> &fo, const T &t)
         : Base(fo, typeid(m_entity))
- , m_entity(t)
+ , m_entity(fo.object(), t)
     {}
     template<typename T>
     framework_entity_adapter(framework_context<BlueprintFramework> &fo, T &t)
         : Base(fo, typeid(m_entity))
+ , m_entity(fo.object(), t)
+ {}
+ template<typename T>
+ framework_entity_adapter(framework_context<BlueprintFramework> &fo, const entity_type &t)
+ : Base(fo, typeid(m_entity))
         , m_entity(t)
     {}
     entity_type &entity()

Modified: sandbox/dataflow-rewrite/boost/dataflow/managed/component.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/managed/component.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/managed/component.hpp 2008-12-03 16:53:02 EST (Wed, 03 Dec 2008)
@@ -14,7 +14,7 @@
 {
 public:
     component(network &network_context);
- virtual ~component(){}
+ virtual ~component();
     network &network_context()
     { return m_network_context; }
     virtual void invoke(){};

Modified: sandbox/dataflow-rewrite/boost/dataflow/managed/network.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/managed/network.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/managed/network.hpp 2008-12-03 16:53:02 EST (Wed, 03 Dec 2008)
@@ -46,6 +46,13 @@
         m_descriptor_map[c]=v;
         std::cout << m_descriptor_map.size() << std::endl;
     }
+ void unregister_component(component *c)
+ {
+ std::cout << this << " unregistering " << c << std::endl;
+ BOOST_ASSERT(m_descriptor_map.find(c) != m_descriptor_map.end());
+ graph_type::vertex_descriptor v = m_descriptor_map[c];
+ remove_vertex(v, m_graph);
+ }
     void notify_connect(component &producer, component &consumer)
     {
         std::cout << this << " connecting " << &producer << " and " << &consumer << std::endl;

Modified: sandbox/dataflow-rewrite/libs/dataflow/src/managed/component.cpp
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/src/managed/component.cpp (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/src/managed/component.cpp 2008-12-03 16:53:02 EST (Wed, 03 Dec 2008)
@@ -13,5 +13,11 @@
     network_context.register_component(this);
 };
 
+component::~component()
+{
+ m_network_context.unregister_component(this);
+}
+
+
 }}}
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk