SAGA Adaptor CPI v.1.0
bulk_strategy_base.cpp
Go to the documentation of this file.
00001 //  Copyright (c) 2005 Stephan Hirmer (shirmer@cct.lsu.edu)
00002 // 
00003 //  Use, modification and distribution is subject to the Boost Software
00004 //  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
00005 //  http://www.boost.org/LICENSE_1_0.txt)
00006 
00007 #include <boost/tokenizer.hpp>
00008 
00009 #include <saga/saga/util.hpp>
00010 #include <saga/impl/engine/task_base.hpp>
00011 #include <saga/saga/adaptors/task_declaration.hpp>
00012 #include <saga/impl/runtime.hpp>
00013 
00014 #include <saga/saga/adaptors/bulk_strategy_base.hpp>
00015 #include <saga/impl/engine/task_container.hpp>
00016 
00017 namespace saga
00018 {
00019     namespace adaptors
00020     {
00021         
00022         saga::impl::task_container* tc;
00023         
00024         // task_blocker_for_bulk
00025         // moved here, to avoid messing up include dependencies.        
00026         // constructor
00027         task_blocker_for_bulk ::task_blocker_for_bulk(impl::task_container* tc_)
00028         : tc(tc_)
00029         {
00030             tc->set_tasks_for_bulk_treatement(
00031                   impl::task_base::actual_bulk_treated);
00032         }
00033 
00034         task_blocker_for_bulk ::~task_blocker_for_bulk(void)
00035         {
00036             tc->set_tasks_for_bulk_treatement(
00037                     impl::task_base::was_bulk_treated);
00038         }
00039         // end task_blocker_for_bulks
00040         
00041         bulk_strategy_base::bulk_strategy_base(void) 
00042         {
00043         }
00044                   
00045         // default destructor
00046         bulk_strategy_base::~bulk_strategy_base (void)
00047         {
00048         }
00049         
00050         void bulk_strategy_base::apply(sorted_tc_type& analyser_res_)
00051         {
00052             SAGA_THROW("Don't call apply on strategy base class!", 
00053                 saga::NotImplemented);
00054         }
00055         
00056         void bulk_strategy_base::complete_wait(void)
00057         {
00058             this->thread_();
00059         }
00060         
00061         
00062         void bulk_strategy_base::default_process_func_name(
00063                       std::string const& func_name, std::string& cpi_name_,
00064                       std::string& op_name_)
00065         {
00066             typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
00067             boost::char_separator<char> sep("::");
00068             tokenizer tokens( func_name, sep);
00069             tokenizer::iterator tok_iter = tokens.begin();
00070                                         
00071             cpi_name_ = *tok_iter; 
00072             op_name_  = "bulk_";
00073             op_name_ += *(++tok_iter);         
00074         }
00075         
00076         
00077     }
00078 }
00079 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines