ProgramInterface.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 19 14:11:21 CET 2004 ProgramInterface.hpp
3 
4  ProgramInterface.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 ORO_PROGRAMINTERFACE_HPP
39 #define ORO_PROGRAMINTERFACE_HPP
40 
41 #include <string>
42 #include <vector>
43 #include <boost/shared_ptr.hpp>
44 #include "../base/DataSourceBase.hpp"
45 #include "../base/AttributeBase.hpp"
46 #include "../base/ExecutableInterface.hpp"
47 #include "rtt-scripting-config.h"
48 #include "../rtt-fwd.hpp"
49 #include "rtt-scripting-fwd.hpp"
50 
51 namespace RTT
52 { namespace scripting {
53  typedef boost::shared_ptr<ProgramInterface> ProgramInterfacePtr;
54  typedef boost::weak_ptr<ProgramInterface> ProgramInterfaceWPtr;
55 
60  class RTT_SCRIPTING_API ProgramInterface
62  {
63  public:
67  struct RTT_SCRIPTING_API Status {
72  unknown = 0,
76  error
77  };
78  };
79  protected:
81  public:
83 
84  virtual ~ProgramInterface();
85 
89  virtual bool start() = 0;
90 
94  virtual bool pause() = 0;
95 
99  virtual bool step() = 0;
100 
104  virtual bool stop() = 0;
105 
112  virtual bool execute()= 0;
113 
117  virtual void reset() = 0;
118 
122  inline bool isRunning() const { return pStatus == Status::running; }
123 
127  inline bool isPaused() const { return pStatus == Status::paused; }
128 
132  inline bool isStopped() const { return pStatus == Status::stopped; }
133 
137  inline bool inError() const { return pStatus == Status::error; }
138 
139  virtual bool stepDone() const = 0;
140 
144  virtual int getLineNumber() const = 0;
145 
149  Status::ProgramStatus getStatus() const { return pStatus; }
150 
155  virtual std::string getText() const = 0;
156 
160  virtual const std::string& getName() const = 0;
161 
165  virtual std::vector<base::AttributeBase*> getArguments() const = 0;
166 
170  virtual base::AttributeBase* getResult() const = 0;
171 
189  virtual ProgramInterface* copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& replacementdss ) const = 0;
190 
191  virtual ProgramInterface* clone() const = 0;
192 
197  virtual bool needsStart() const = 0;
198 
199  };
200 
201 
202 }}
203 
204 
205 #endif
206 
207 
boost::weak_ptr< ProgramInterface > ProgramInterfaceWPtr
boost::shared_ptr< ProgramInterface > ProgramInterfacePtr
The program was running but is now paused.
Status::ProgramStatus getStatus() const
This program is currently not loaded in an ExecutionEngine.
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.


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