Orocos Real-Time Toolkit  2.8.3
VertexNode.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 19 14:11:21 CET 2004 VertexNode.hpp
3 
4  VertexNode.hpp - description
5  -------------------
6  begin : Mon January 19 2004
7  copyright : (C) 2004 Peter Soetens
8  email : peter.soetens@mech.kuleuven.ac.be
9 
10  ***************************************************************************
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU General Public *
13  * License as published by the Free Software Foundation; *
14  * version 2 of the License. *
15  * *
16  * As a special exception, you may use this file as part of a free *
17  * software library without restriction. Specifically, if other files *
18  * instantiate templates or use macros or inline functions from this *
19  * file, or you compile this file and link it with other files to *
20  * produce an executable, this file does not by itself cause the *
21  * resulting executable to be covered by the GNU General Public *
22  * License. This exception does not however invalidate any other *
23  * reasons why the executable file might be covered by the GNU General *
24  * Public License. *
25  * *
26  * This library is distributed in the hope that it will be useful, *
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29  * Lesser General Public License for more details. *
30  * *
31  * You should have received a copy of the GNU General Public *
32  * License along with this library; if not, write to the Free Software *
33  * Foundation, Inc., 59 Temple Place, *
34  * Suite 330, Boston, MA 02111-1307 USA *
35  * *
36  ***************************************************************************/
37 
38 #ifndef VERTEXNODE_HPP
39 #define VERTEXNODE_HPP
40 
41 #include "rtt-scripting-config.h"
42 #include <map>
43 #include "../base/ActionInterface.hpp"
44 
45 // adjacency_list has some very short template parameter names,
46 // which may be defined as macros on some OS's. So undef here.
47 #undef DS
48 #undef OEL
49 #undef VL
50 #undef VP
51 #undef EP
52 #undef GP
53 #undef EL
54 #define BOOST_NO_HASH
55 #include <boost/graph/adjacency_list.hpp>
56 
57 namespace RTT
58 { namespace scripting {
61 }}
62 
63 namespace boost {
66  BOOST_INSTALL_PROPERTY(vertex, command);
67  BOOST_INSTALL_PROPERTY(vertex, exec);
68 }
69 
70 namespace RTT
71 { namespace scripting {
72 
77  {
78  public:
82  enum NodeTypes { normal_node, prog_start_node, prog_exit_node, func_start_node, func_exit_node };
83  typedef boost::property<vertex_command_t, VertexNode,
84  boost::property<vertex_exec_t, int,
85  boost::property<boost::vertex_index_t, int> > > VertProperty;
86 
91  VertexNode();
92 
97  explicit VertexNode(base::ActionInterface* cmd);
98 
102  VertexNode( const VertexNode& orig );
103 
104  VertexNode copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& rdss ) const;
105 
106  VertexNode& operator=( const VertexNode& orig );
107 
108  public:
118 // static VertexNode* leafNode( ProcessorInterface* proc)
119 // {
120 // CommandStopExecution* cmd = new CommandStopExecution( proc );
121 // return new VertexNode( cmd );
122 // }
123 
124  ~VertexNode();
125 
138  void startExecution();
139 
144  bool execute();
145 
149  bool isValid() const;
158 
165  void setLineNumber(int ln);
166 
174  base::ActionInterface* getCommand() const;
175 
180  int getLineNumber() const;
181  private:
182 
186  base::ActionInterface* command;
187 
193  int lineNumber;
194 
195  };
196 }}
197 
198 #endif
199 
200 
201 
NodeTypes
The vertex_exec_t property values.
Definition: VertexNode.hpp:82
This class represents elements in a program tree.
Definition: VertexNode.hpp:76
#define RTT_SCRIPTING_API
BOOST_INSTALL_PROPERTY(vertex, exec)
Based on the software pattern &#39;command&#39;, this interface allows execution of action objects...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:51
boost::property< vertex_command_t, VertexNode, boost::property< vertex_exec_t, int, boost::property< boost::vertex_index_t, int > > > VertProperty
Definition: VertexNode.hpp:85