ValueChangeParser.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 19 14:11:26 CET 2004 ValueChangeParser.hpp
3 
4  ValueChangeParser.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 VALUECHANGEPARSER_HPP
39 #define VALUECHANGEPARSER_HPP
40 
41 #include "parser-types.hpp"
42 
43 #include "../Attribute.hpp"
44 #include "CommonParser.hpp"
45 #include "ExpressionParser.hpp"
46 #include "PeerParser.hpp"
47 #include "PropertyParser.hpp"
48 #include "../types/Types.hpp"
49 #include "../Service.hpp"
50 
51 namespace RTT { namespace scripting
52 {
61  {
62  // all the AssignVariableCommand we've built..
63  // This list is cleared in cleanup().
64  std::vector<base::ActionInterface*> assigncommands;
65  std::vector<scripting::ConditionInterface*> conditions;
66 
67  // the defined values...
68  // This list is cleared in cleanup().
69  std::vector<base::AttributeBase*> definedvalues;
70 
71  // the parsed variable or constant or alias or param
72  // definition name.
73  // This list is cleared in cleanup().
74  std::vector<std::string> definednames;
75 
76  // A list of all the names stored in \a context.
77  // this list is used to remove them when reset() is
78  // called.
79  std::vector<std::string> alldefinednames;
80 
81  // the name of the value of which we're currently parsing the
82  // definition or assignment..
83  std::string valuename;
84 
85  // A types::TypeInfo of the type that was specified. We use it to get
86  // hold of a Constant or a TaskVariable or ...
88 
90  void seenaliasdefinition();
92  void seenbaredefinition();
93  void seenparamdefinition();
94  void storedefinitionname( iter_t begin, iter_t end );
95  void seentype( iter_t begin, iter_t end );
96  void seensizehint();
97  void seenproperty();
98 
103 
108 
109  int sizehint;
110  boost::shared_ptr<types::TypeInfoRepository> typerepos;
111 
115  void cleanup();
116  public:
127  Service::shared_ptr storage,
128  ExecutionEngine* caller);
129 
134  void clear();
135 
141  void store( Service::shared_ptr other );
142 
149  void load( Service::shared_ptr source );
150 
159  {
160  if ( assigncommands.empty() )
161  return 0;
162  return assigncommands.back();
163  }
164 
165  std::vector<base::ActionInterface*> assignCommands()
166  {
167  return assigncommands;
168  }
169 
170  std::vector<scripting::ConditionInterface*> assignConditions()
171  {
172  return conditions;
173  }
174 
176  {
177  if ( definedvalues.empty() )
178  return 0;
179  return definedvalues.back();
180  }
181 
182  std::vector<base::AttributeBase*> definedValues()
183  {
184  return definedvalues;
185  }
186 
187  std::string lastDefinedName()
188  {
189  if ( definednames.empty() )
190  return "";
191  return definednames.back();
192  }
193 
194  std::vector<std::string> definedNames()
195  {
196  return definednames;
197  }
198 
199  std::vector<std::string> allDefinedNames()
200  {
201  return alldefinednames;
202  }
203 
209  rule_t& parser();
210 
217 
224 
231 
238 
245 
250  void reset();
251  };
252 }}
253 
254 #endif
std::vector< base::AttributeBase * > definedValues()
boost::shared_ptr< types::TypeInfoRepository > typerepos
void storedefinitionname(iter_t begin, iter_t end)
void load(Service::shared_ptr source)
std::vector< std::string > allDefinedNames()
base::ActionInterface * assignCommand()
std::vector< scripting::ConditionInterface * > conditions
This class contains some very common parser definitions.
std::vector< scripting::ConditionInterface * > assignConditions()
boost::shared_ptr< Service > shared_ptr
Definition: Service.hpp:101
void store(Service::shared_ptr other)
std::vector< base::AttributeBase * > definedvalues
std::vector< base::ActionInterface * > assigncommands
Based on the software pattern &#39;command&#39;, this interface allows execution of action objects...
std::vector< std::string > definedNames()
rule< scanner_t > rule_t
std::vector< std::string > definednames
std::vector< std::string > alldefinednames
base::AttributeBase * lastDefinedValue()
std::vector< base::ActionInterface * > assignCommands()
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53
our_pos_iter_t iter_t
ValueChangeParser(TaskContext *tc, CommonParser &cp, Service::shared_ptr storage, ExecutionEngine *caller)
void seentype(iter_t begin, iter_t end)


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:45