Orocos Real-Time Toolkit  2.8.3
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
RTT::Scripting Class Reference

The method interface of the scripting plugin. More...

#include <rtt/scripting/Scripting.hpp>

Inheritance diagram for RTT::Scripting:
RTT::ServiceRequester

Public Types

typedef scripting::ProgramInterface::Status ProgramStatus
 
typedef scripting::StateMachine::Status StateMachineStatus
 
typedef std::vector< std::string > RequesterNames
 
typedef std::vector< std::string > OperationCallerNames
 
typedef boost::shared_ptr< ServiceRequestershared_ptr
 
typedef boost::shared_ptr< const ServiceRequestershared_constptr
 

Public Member Functions

 Scripting (TaskContext *owner)
 
 ~Scripting ()
 
const std::string & getRequestName () const
 
RequesterNames getRequesterNames () const
 
TaskContextgetServiceOwner () const
 The owner is the top-level TaskContext owning this service (indirectly). More...
 
void setOwner (TaskContext *new_owner)
 Sets the owning TaskContext that is considered as the caller of requested operations. More...
 
Service::shared_ptr getReferencedService ()
 Returns the service we're referencing. More...
 
bool addOperationCaller (base::OperationCallerBaseInvoker &mbi)
 
OperationCallerNames getOperationCallerNames () const
 
base::OperationCallerBaseInvokergetOperationCaller (const std::string &name)
 
ServiceRequester::shared_ptr requires ()
 
ServiceRequester::shared_ptr requires (const std::string &service_name)
 
bool addServiceRequester (shared_ptr obj)
 Add a new ServiceRequester to this TaskContext. More...
 
bool requiresService (const std::string &service_name)
 Query if this service requires certain sub-services. More...
 
virtual bool connectTo (Service::shared_ptr sp)
 Connects this service's methods to the operations provided by op. More...
 
virtual bool ready () const
 Returns true when all methods were resolved. More...
 
virtual void disconnect ()
 Disconnects all methods from their implementation. More...
 
virtual void clear ()
 Remove all operation callers from this service requester. More...
 

Public Attributes

OperationCaller< bool(const std::string &)> unloadProgram
 
OperationCaller< ProgramStatus::ProgramStatus(const std::string &)> getProgramStatus
 
OperationCaller< std::string(const std::string &)> getProgramStatusStr
 
OperationCaller< std::vector< std::string >void)> getProgramList
 
OperationCaller< bool(const std::string &)> unloadStateMachine
 
OperationCaller< StateMachineStatus::StateMachineStatus(const std::string &)> getStateMachineStatus
 
OperationCaller< std::string(const std::string &)> getStateMachineStatusStr
 
OperationCaller< std::vector< std::string >)> getStateMachineList
 
OperationCaller< int(const std::string &)> execute
 
OperationCaller< bool(const std::string &)> runScript
 
OperationCaller< bool(const std::string &)> eval
 
OperationCaller< bool(const std::string &)> loadPrograms
 
OperationCaller< bool(const std::string &)> loadProgramText
 
OperationCaller< int(const std::string &)> getProgramLine
 
OperationCaller< std::string(const std::string &)> getProgramText
 
OperationCaller< bool(const std::string &)> loadStateMachines
 
OperationCaller< bool(const std::string &code)> loadStateMachineText
 
OperationCaller< std::string(const std::string &)> getStateMachineText
 
OperationCaller< int(const std::string &)> getStateMachineLine
 
OperationCaller< bool(const std::string &)> startProgram
 
OperationCaller< bool(const std::string &)> stopProgram
 
OperationCaller< bool(const std::string &)> pauseProgram
 
OperationCaller< bool(const std::string &)> stepProgram
 
OperationCaller< bool(const std::string &)> hasProgram
 
OperationCaller< bool(const std::string &)> isProgramRunning
 
OperationCaller< bool(const std::string &)> isProgramPaused
 
OperationCaller< bool(const std::string &)> inProgramError
 
OperationCaller< bool(const std::string &)> activateStateMachine
 
OperationCaller< bool(const std::string &)> deactivateStateMachine
 
OperationCaller< bool(const std::string &)> startStateMachine
 
OperationCaller< bool(const std::string &)> pauseStateMachine
 
OperationCaller< bool(const std::string &)> stopStateMachine
 
OperationCaller< bool(const std::string &)> resetStateMachine
 
OperationCaller< bool(const std::string &, const std::string &)> requestStateMachineState
 
OperationCaller< bool(const std::string &)> hasStateMachine
 
OperationCaller< bool(const std::string &)> isStateMachineActive
 
OperationCaller< bool(const std::string &)> isStateMachineRunning
 
OperationCaller< bool(const std::string &)> inStateMachineError
 
OperationCaller< bool(const std::string &)> isStateMachinePaused
 
OperationCaller< std::string(const std::string &)> getStateMachineState
 
OperationCaller< bool(const std::string &, const std::string &)> inStateMachineState
 

Protected Types

typedef std::map< std::string, ServiceRequester::shared_ptrRequests
 
typedef std::map< std::string, base::OperationCallerBaseInvoker * > OperationCallers
 Our methods. More...
 

Protected Attributes

Requests mrequests
 the services we implement. More...
 
OperationCallers mmethods
 
std::string mrname
 
TaskContextmrowner
 
Service::shared_ptr mprovider
 

Detailed Description

The method interface of the scripting plugin.

Definition at line 54 of file Scripting.hpp.

Member Typedef Documentation

typedef std::vector<std::string> RTT::ServiceRequester::OperationCallerNames
inherited

Definition at line 86 of file ServiceRequester.hpp.

typedef std::map<std::string, base::OperationCallerBaseInvoker*> RTT::ServiceRequester::OperationCallers
protectedinherited

Our methods.

Definition at line 186 of file ServiceRequester.hpp.

Definition at line 60 of file Scripting.hpp.

typedef std::vector<std::string> RTT::ServiceRequester::RequesterNames
inherited

Definition at line 85 of file ServiceRequester.hpp.

typedef std::map< std::string, ServiceRequester::shared_ptr > RTT::ServiceRequester::Requests
protectedinherited

Definition at line 181 of file ServiceRequester.hpp.

typedef boost::shared_ptr<const ServiceRequester> RTT::ServiceRequester::shared_constptr
inherited

Definition at line 88 of file ServiceRequester.hpp.

typedef boost::shared_ptr<ServiceRequester> RTT::ServiceRequester::shared_ptr
inherited

Definition at line 61 of file Scripting.hpp.

Constructor & Destructor Documentation

RTT::Scripting::Scripting ( TaskContext owner)
RTT::Scripting::~Scripting ( )

Definition at line 178 of file Scripting.cpp.

Member Function Documentation

bool RTT::ServiceRequester::addOperationCaller ( base::OperationCallerBaseInvoker mbi)
inherited
bool RTT::ServiceRequester::addServiceRequester ( ServiceRequester::shared_ptr  obj)
inherited

Add a new ServiceRequester to this TaskContext.

Parameters
objThis object becomes owned by this TaskContext.
Returns
true if it could be added, false if such service requester already exists.

Definition at line 122 of file ServiceRequester.cpp.

References RTT::Error, RTT::ServiceRequester::mrequests, and RTT::ServiceRequester::mrowner.

void RTT::ServiceRequester::clear ( )
virtualinherited

Remove all operation callers from this service requester.

Definition at line 185 of file ServiceRequester.cpp.

References RTT::ServiceRequester::mmethods, and RTT::ServiceRequester::mrequests.

bool RTT::ServiceRequester::connectTo ( Service::shared_ptr  sp)
virtualinherited

Connects this service's methods to the operations provided by op.

This method tries to match as many as possible method-operation pairs.

You may call this function with different instances of sp to 'resolve' missing functions, only the non-connected methods will be further filled in.

Parameters
spAn interface-compatible Service.
Returns
true if all methods of that are required are provided, false if not all methods could yet be matched.

Definition at line 136 of file ServiceRequester.cpp.

References RTT::Debug, RTT::base::TaskCore::engine(), RTT::Info, RTT::ServiceRequester::mmethods, RTT::ServiceRequester::mprovider, RTT::ServiceRequester::mrname, RTT::ServiceRequester::mrowner, and RTT::ServiceRequester::ready().

void RTT::ServiceRequester::disconnect ( )
virtualinherited

Disconnects all methods from their implementation.

Definition at line 168 of file ServiceRequester.cpp.

References RTT::base::OperationCallerBaseInvoker::disconnect(), and RTT::ServiceRequester::mmethods.

OperationCallerBaseInvoker * RTT::ServiceRequester::getOperationCaller ( const std::string &  name)
inherited

Definition at line 84 of file ServiceRequester.cpp.

References RTT::ServiceRequester::mmethods.

std::vector< std::string > RTT::ServiceRequester::getOperationCallerNames ( ) const
inherited

Definition at line 74 of file ServiceRequester.cpp.

References RTT::internal::keys(), and RTT::ServiceRequester::mmethods.

Service::shared_ptr RTT::ServiceRequester::getReferencedService ( )
inlineinherited

Returns the service we're referencing.

In case you used connectTo to more than one service, this returns the service which was used when connectTo first returned true.

Definition at line 120 of file ServiceRequester.hpp.

std::vector< std::string > RTT::ServiceRequester::getRequesterNames ( ) const
inherited

Definition at line 79 of file ServiceRequester.cpp.

References RTT::internal::keys(), and RTT::ServiceRequester::mrequests.

const std::string& RTT::ServiceRequester::getRequestName ( ) const
inlineinherited

Definition at line 98 of file ServiceRequester.hpp.

TaskContext* RTT::ServiceRequester::getServiceOwner ( ) const
inlineinherited

The owner is the top-level TaskContext owning this service (indirectly).

Definition at line 106 of file ServiceRequester.hpp.

bool RTT::ServiceRequester::ready ( ) const
virtualinherited

Returns true when all methods were resolved.

Returns

Definition at line 175 of file ServiceRequester.cpp.

References RTT::Debug, and RTT::ServiceRequester::mmethods.

Referenced by RTT::ServiceRequester::connectTo().

ServiceRequester::shared_ptr RTT::ServiceRequester::requires ( )
inherited

Definition at line 100 of file ServiceRequester.cpp.

References RTT::Error.

Referenced by RTT::ServiceRequester::requires().

ServiceRequester::shared_ptr RTT::ServiceRequester::requires ( const std::string &  service_name)
inherited
bool RTT::ServiceRequester::requiresService ( const std::string &  service_name)
inlineinherited

Query if this service requires certain sub-services.

Parameters
service_name
Returns

Definition at line 147 of file ServiceRequester.hpp.

void RTT::ServiceRequester::setOwner ( TaskContext new_owner)
inherited

Sets the owning TaskContext that is considered as the caller of requested operations.

Definition at line 92 of file ServiceRequester.cpp.

References RTT::base::TaskCore::engine(), RTT::ServiceRequester::mmethods, and RTT::ServiceRequester::mrowner.

Member Data Documentation

OperationCaller<bool (const std::string& )> RTT::Scripting::activateStateMachine

Definition at line 117 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::deactivateStateMachine

Definition at line 119 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string& )> RTT::Scripting::eval

Definition at line 83 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<int (const std::string& )> RTT::Scripting::execute

Definition at line 79 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<int (const std::string& )> RTT::Scripting::getProgramLine

Definition at line 89 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::vector<std::string>void)> RTT::Scripting::getProgramList

Definition at line 69 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<ProgramStatus::ProgramStatus (const std::string& )> RTT::Scripting::getProgramStatus

Definition at line 65 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::string (const std::string& )> RTT::Scripting::getProgramStatusStr

Definition at line 67 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::string (const std::string& )> RTT::Scripting::getProgramText

Definition at line 91 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<int (const std::string& )> RTT::Scripting::getStateMachineLine

Definition at line 99 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::vector<std::string>)> RTT::Scripting::getStateMachineList

Definition at line 77 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::string (const std::string& )> RTT::Scripting::getStateMachineState

Definition at line 141 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<StateMachineStatus::StateMachineStatus (const std::string& )> RTT::Scripting::getStateMachineStatus

Definition at line 73 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::string (const std::string& )> RTT::Scripting::getStateMachineStatusStr

Definition at line 75 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<std::string (const std::string& )> RTT::Scripting::getStateMachineText

Definition at line 97 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::hasProgram

Definition at line 109 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::hasStateMachine

Definition at line 131 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::inProgramError

Definition at line 115 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::inStateMachineError

Definition at line 137 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& , const std::string& )> RTT::Scripting::inStateMachineState

Definition at line 143 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::isProgramPaused

Definition at line 113 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::isProgramRunning

Definition at line 111 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::isStateMachineActive

Definition at line 133 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::isStateMachinePaused

Definition at line 139 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::isStateMachineRunning

Definition at line 135 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string&)> RTT::Scripting::loadPrograms

Definition at line 85 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string& )> RTT::Scripting::loadProgramText

Definition at line 87 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string& )> RTT::Scripting::loadStateMachines

Definition at line 93 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string& code )> RTT::Scripting::loadStateMachineText

Definition at line 95 of file Scripting.hpp.

Referenced by Scripting().

OperationCallers RTT::ServiceRequester::mmethods
protectedinherited
Service::shared_ptr RTT::ServiceRequester::mprovider
protectedinherited

Definition at line 191 of file ServiceRequester.hpp.

Referenced by RTT::ServiceRequester::connectTo().

Requests RTT::ServiceRequester::mrequests
protectedinherited
std::string RTT::ServiceRequester::mrname
protectedinherited

Definition at line 189 of file ServiceRequester.hpp.

Referenced by RTT::ServiceRequester::connectTo().

TaskContext* RTT::ServiceRequester::mrowner
protectedinherited
OperationCaller<bool (const std::string& )> RTT::Scripting::pauseProgram

Definition at line 105 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::pauseStateMachine

Definition at line 123 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& , const std::string& )> RTT::Scripting::requestStateMachineState

Definition at line 129 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::resetStateMachine

Definition at line 127 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string&)> RTT::Scripting::runScript

Definition at line 81 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::startProgram

Definition at line 101 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::startStateMachine

Definition at line 121 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::stepProgram

Definition at line 107 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::stopProgram

Definition at line 103 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::stopStateMachine

Definition at line 125 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool (const std::string& )> RTT::Scripting::unloadProgram

Definition at line 63 of file Scripting.hpp.

Referenced by Scripting().

OperationCaller<bool ( const std::string& )> RTT::Scripting::unloadStateMachine

Definition at line 71 of file Scripting.hpp.

Referenced by Scripting().


The documentation for this class was generated from the following files: