ScriptingAccess.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef ORO_EXECUTION_SCRIPTING_ACCESS
00040 #define ORO_EXECUTION_SCRIPTING_ACCESS
00041
00042 #include <vector>
00043 #include <string>
00044 #include "ProgramInterface.hpp"
00045 #include "DispatchInterface.hpp"
00046
00047 namespace RTT
00048 {
00049 class TaskContext;
00050
00056 class RTT_API ScriptingAccess
00057 {
00058 protected:
00059 TaskContext* mparent;
00060 public:
00061 ScriptingAccess( TaskContext* parent )
00062 : mparent(parent)
00063 {}
00064
00065 virtual ~ScriptingAccess();
00066
00076 virtual int execute(const std::string& code );
00077
00085 virtual DispatchInterface::shared_ptr getCommand( int ticket );
00086
00090 typedef std::vector< ProgramInterfacePtr > Functions;
00091
00101 virtual Functions loadFunctions(std::string filename, bool do_throw = false );
00102
00113 virtual Functions loadFunctions(std::string code, std::string filename, bool do_throw = false );
00114
00125 virtual bool loadPrograms( std::string filename, bool do_throw = false );
00126
00138 virtual bool loadPrograms( std::string code, std::string filename, bool do_throw = false );
00139
00149 virtual bool unloadProgram( std::string name, bool do_throw = false );
00150
00157 virtual std::vector<std::string> getPrograms() const;
00158
00166 virtual bool hasProgram(std::string name) const;
00167
00178 virtual int getProgramLine(std::string name) const;
00179
00187 virtual std::string getProgramText(std::string name ) const;
00188
00196 virtual std::string getProgramStatus(std::string name ) const;
00197
00208 virtual bool loadStateMachines( std::string filename, bool do_throw = false );
00209
00221 virtual bool loadStateMachines( std::string code, std::string filename, bool do_throw = false );
00222
00232 virtual bool unloadStateMachine( std::string name, bool do_throw = false );
00233
00241 virtual bool hasStateMachine(std::string name) const;
00242
00249 virtual std::vector<std::string> getStateMachines() const;
00250
00258 virtual std::string getStateMachineText(std::string name ) const;
00259
00267 virtual std::string getStateMachineStatus(std::string name ) const;
00268
00279 virtual int getStateMachineLine(std::string name ) const;
00280
00288 virtual std::string getCurrentState(std::string name ) const;
00289 };
00290 }
00291
00292 #endif