Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50105 - in sandbox/dataflow-rewrite: boost/dataflow/blueprint libs/dataflow/test/blueprint
From: stipe_at_[hidden]
Date: 2008-12-03 23:40:08


Author: srajko
Date: 2008-12-03 23:40:08 EST (Wed, 03 Dec 2008)
New Revision: 50105
URL: http://svn.boost.org/trac/boost/changeset/50105

Log:
factory accepts a ProducedType
Text files modified:
   sandbox/dataflow-rewrite/boost/dataflow/blueprint/factory.hpp | 11 +++++------
   sandbox/dataflow-rewrite/libs/dataflow/test/blueprint/test_factory.cpp | 2 +-
   2 files changed, 6 insertions(+), 7 deletions(-)

Modified: sandbox/dataflow-rewrite/boost/dataflow/blueprint/factory.hpp
==============================================================================
--- sandbox/dataflow-rewrite/boost/dataflow/blueprint/factory.hpp (original)
+++ sandbox/dataflow-rewrite/boost/dataflow/blueprint/factory.hpp 2008-12-03 23:40:08 EST (Wed, 03 Dec 2008)
@@ -50,13 +50,12 @@
     friend class boost::iterator_core_access;
 };
 
-template<typename BlueprintFramework, typename AdditionalArgs=mpl::vector<> >
+template<typename BlueprintFramework, typename AdditionalArgs=mpl::vector<>, typename ProducedType=framework_entity<BlueprintFramework> >
 class factory
 {
 public:
     typedef typename BlueprintFramework::framework_type framework_type;
- typedef framework_entity<BlueprintFramework> entity_type;
- typedef framework_entity<BlueprintFramework> framework_entity_type;
+ typedef ProducedType produced_type;
     typedef framework_context<BlueprintFramework> framework_context_type;
     typedef
         typename function_types::function_type
@@ -65,7 +64,7 @@
             <
                 mpl::vector
                 <
- framework_entity_type *,
+ produced_type *,
                     framework_context_type &
>,
                 AdditionalArgs
@@ -77,9 +76,9 @@
 
     typedef key_iterator<map_type> iterator;
     
- std::auto_ptr<entity_type> make(const std::string &key)
+ std::auto_ptr<produced_type> make(const std::string &key)
     {
- std::auto_ptr<entity_type> ret(m_components[key]());
+ std::auto_ptr<produced_type> ret(m_components[key]());
         return ret;
     }
     key_iterator<map_type> begin()

Modified: sandbox/dataflow-rewrite/libs/dataflow/test/blueprint/test_factory.cpp
==============================================================================
--- sandbox/dataflow-rewrite/libs/dataflow/test/blueprint/test_factory.cpp (original)
+++ sandbox/dataflow-rewrite/libs/dataflow/test/blueprint/test_factory.cpp 2008-12-03 23:40:08 EST (Wed, 03 Dec 2008)
@@ -34,7 +34,7 @@
 
 struct constructor_int
 {
- factory_int_type::framework_entity_type *operator()(factory_int_type::framework_context_type &c, int x) const
+ factory_int_type::produced_type *operator()(factory_int_type::framework_context_type &c, int x) const
     {
         return new df::blueprint::port_adapter<my_blueprint_framework, my_port_producer>(c);
     }


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