41 #include "../base/AttributeBase.hpp" 44 #include "../Service.hpp" 49 #include <boost/graph/copy.hpp> 53 using namespace detail;
54 using namespace boost;
60 : myName(_name), retn(0), pausing(false), mstep(false), munload_on_stop(unload_on_stop)
73 graph_traits<Graph>::vertex_iterator v1,v2, it;
75 for ( it=v1; it != v2; ++it)
79 for ( it=v1; it != v2; ++it)
85 std::vector<AttributeBase*> argsvect = orig.
getArguments();
86 std::vector<AttributeBase*>::iterator ita = argsvect.begin();
87 for ( ; ita != argsvect.end(); ++ita)
88 this->
args.push_back( (*ita)->clone() );
102 property_map<Graph, vertex_index_t>::type
103 index =
get(vertex_index,
program);
107 graph_traits<Graph>::vertex_iterator vi, vend;
108 graph_traits<Graph>::vertices_size_type cnt = 0;
109 for(tie(vi,vend) = vertices(
program); vi != vend; ++vi)
110 put(index, *vi, cnt++);
120 std::vector<AttributeBase*>::iterator it =
args.begin();
121 for ( ; it !=
args.end(); ++it)
196 return mstep ==
false;
230 graph_traits<Graph>::out_edge_iterator ei, ei_end;
232 boost::property_map<Graph, vertex_command_t>::type
234 boost::property_map<Graph, edge_condition_t>::type
244 for ( tie(ei, ei_end) = boost::out_edges(
current,
program ); ei != ei_end; ++ei)
247 cmap[
current].startExecution();
265 if ( cmap[
current].isValid() ) {
266 for ( tie(ei, ei_end) = boost::out_edges(
current,
program ); ei != ei_end; ++ei) {
268 if ( emap[*ei].evaluate() ) {
292 graph_traits<Graph>::out_edge_iterator ei, ei_end;
294 boost::property_map<Graph, vertex_command_t>::type
296 boost::property_map<Graph, edge_condition_t>::type
302 for ( tie(ei, ei_end) = boost::out_edges(
current,
program ); ei != ei_end; ++ei)
305 cmap[
current].startExecution();
322 if ( cmap[
current].isValid() ) {
323 for ( tie(ei, ei_end) = boost::out_edges(
current,
program ); ei != ei_end; ++ei) {
325 if ( emap[*ei].evaluate() ) {
385 typedef boost::property_map<Graph, vertex_index_t>::const_type indexmap_t;
386 typedef boost::graph_traits<Graph>::vertex_descriptor vd_t;
387 typedef std::vector<vd_t> o2cvect_t;
388 typedef boost::iterator_property_map<o2cvect_t::iterator, indexmap_t, vd_t, vd_t&> o2cmap_t;
395 indexmap_t indexmap =
get( vertex_index,
program );
397 o2cvect_t o2cvect( num_vertices(
program ) );
398 o2cmap_t o2cmap( o2cvect.begin(), indexmap );
408 for (
unsigned int i=0; i <
args.size(); ++i)
414 boost::vertex_copy( GraphVertexCopier(
program, ret->
program, replacementdss ) ).
415 edge_copy( GraphEdgeCopier(
program, ret->
program, replacementdss ) ).
416 orig_to_copy( o2cmap ) );
439 graph_traits<Graph>::vertex_iterator v,vend;
440 tie(v,vend) = vertices(
program);
441 boost::property_map<Graph, vertex_command_t>::const_type
443 boost::property_map<Graph, vertex_index_t>::const_type
444 imap =
get(vertex_index,
program);
446 std::cerr <<
" number of vertices: " << boost::num_vertices(
program) <<
std::endl;
447 for ( ; v != vend; ++v )
449 int index =
get( imap, *v );
452 std::cerr <<
" " << index <<
" " <<
typeid( *cmd ).name() <<
std::endl;
454 std::cerr <<
" " << index <<
" (null)" <<
std::endl;
460 for (std::vector<AttributeBase*>::iterator it =
args.begin(); it !=
args.end(); ++it)
virtual bool stepDone() const
const Graph & getGraph() const
void debugPrintout() const
void setUnloadOnStop(bool unload_on_stop)
virtual AttributeBase * copy(std::map< const DataSourceBase *, DataSourceBase * > &replacements, bool instantiate)=0
virtual bool removeFunction(base::ExecutableInterface *f)
virtual AttributeBase * clone() const =0
std::vector< base::AttributeBase * > args
virtual FunctionGraph * clone() const
void setResult(base::AttributeBase *r)
virtual const std::string & getName() const
base::AttributeBase * retn
boost::shared_ptr< Service > shared_ptr
std::string getText() const
virtual int getLineNumber() const
The program was running but is now paused.
Based on the software pattern 'command', this interface allows execution of action objects...
Status::ProgramStatus pStatus
std::vector< base::AttributeBase * > getArguments() const
void setProgramService(ServicePtr myservice)
basic_ostreams & endl(basic_ostreams &s)
ExecutionEngine * getEngine()
void setName(const std::string &_name)
virtual FunctionGraph * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacementdss) const
This program is currently not loaded in an ExecutionEngine.
FunctionGraph(const std::string &name, bool unload_on_stop)
void addArgument(base::AttributeBase *a)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
The program is not running.
void setText(const std::string &t)