StateDescription.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Thu Apr 22 20:40:59 CEST 2004 StateDescription.hpp
3 
4  StateDescription.hpp - description
5  -------------------
6  begin : Thu April 22 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 STATE_DESCRIPTION_HPP
39 #define STATE_DESCRIPTION_HPP
40 
41 #include "StateInterface.hpp"
42 #include "ProgramInterface.hpp"
43 
44 namespace RTT
45 { namespace scripting {
46 
51  class RTT_SCRIPTING_API StateDescription
52  : public StateInterface
53  {
58  std::string name;
60  bool inited;
61  public:
66  StateDescription(const std::string& _name, int linenr )
67  : mentry(), mexit(), mhandle(), mrun(),
68  name(_name), entrypoint(linenr), inited(false)
69  {
70  }
71 
72  virtual ~StateDescription();
73 
74  const std::string& getName() const { return name; }
75  void setName(const std::string& newname) { name = newname; }
76 
77  void setEntryPoint(int line) { entrypoint = line; }
78  int getEntryPoint() const { return entrypoint; }
79 
91  StateDescription* postponeState();
92 
94  return mentry.get();
95  }
96 
98  return mrun.get();
99  }
100 
102  return mhandle.get();
103  }
104 
106  return mexit.get();
107  }
108 
110  mentry = entry;
111  }
112 
114  mrun = run;
115  }
116 
118  mhandle = handle;
119  }
120 
122  mexit = exit;
123  }
124 
125  bool isDefined() const
126  {
127  return inited;
128  }
129 
130  void setDefined( bool d ) {
131  inited = d;
132  }
133 
134  StateDescription* copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& replacementdss ) const;
135 
136  };
137 }}
138 
139 #endif
ProgramInterface * getHandleProgram() const
void setEntryProgram(ProgramInterfacePtr entry)
void setHandleProgram(ProgramInterfacePtr handle)
void setRunProgram(ProgramInterfacePtr run)
const std::string & getName() const
Get the name of this state.
This class represents a state with all actions stored in an external program.
boost::shared_ptr< ProgramInterface > ProgramInterfacePtr
StateDescription(const std::string &_name, int linenr)
ProgramInterface * getEntryProgram() const
void setExitProgram(ProgramInterfacePtr exit)
void setName(const std::string &newname)
ProgramInterface * getRunProgram() const
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53
A Program represents a collection of instructions that can be stepwise executed.
ProgramInterface * getExitProgram() const


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:36