Orocos Real-Time Toolkit
2.5.0
|
This interface allows to load program scripts and state machines and allows execution of code. More...
#include <rtt/scripting/ScriptingService.hpp>
Public Types | |
typedef boost::shared_ptr < ScriptingService > | shared_ptr |
typedef ProgramInterface::Status | ProgramStatus |
typedef scripting::StateMachine::Status | StateMachineStatus |
typedef std::vector < ProgramInterfacePtr > | Functions |
List of executed functions. | |
typedef OperationInterface | Factory |
typedef std::vector< std::string > | ProviderNames |
typedef std::vector < base::DataSourceBase::shared_ptr > | Arguments |
The arguments for an operation. | |
typedef std::vector < ArgumentDescription > | Descriptions |
The descriptions of an argumentlist. | |
typedef std::vector< std::string > | AttributeNames |
A vector containing the names of all attribute objects in this repository. | |
typedef std::vector < base::AttributeBase * > | AttributeObjects |
A vector containing pointers to all attribute objects stored in this repository. | |
typedef std::vector < base::PortInterface * > | Ports |
A sequence of pointers to ports. | |
typedef std::vector< std::string > | PortNames |
A sequence of names of ports. | |
typedef boost::function< void(base::PortInterface *) | SlotFunction ) |
Public Member Functions | |
ScriptingService (TaskContext *parent) | |
Creates a ScriptingService object. | |
bool | loadProgram (ProgramInterfacePtr pi) |
Load a new Program. | |
bool | deleteProgram (const std::string &name) |
Completely discard a loaded Program. | |
bool | unloadProgram (const std::string &name) |
Unload a program from this processor. | |
void | clear () |
Stop and unload all program scripts. | |
ProgramStatus::ProgramStatus | getProgramStatus (const std::string &name) const |
Return the status of a Program. | |
std::string | getProgramStatusStr (const std::string &name) const |
Return the status of a Program as a human readable string. | |
std::vector< std::string > | getProgramList () const |
Get a list of all loaded Programs. | |
const ProgramInterfacePtr | getProgram (const std::string &name) const |
Get a pointer to a loaded Program. | |
ProgramInterfacePtr | getProgram (const std::string &name) |
bool | loadStateMachine (StateMachinePtr sc) |
Load a new State Machine and all its children. | |
bool | unloadStateMachine (const std::string &name) |
Unload a deactivated State Machine and all its children. | |
bool | deleteStateMachine (const std::string &name) |
Delete a deactivated State Machine and all its children. | |
StateMachineStatus::StateMachineStatus | getStateMachineStatus (const std::string &name) const |
Return the status of a StateMachine. | |
std::string | getStateMachineStatusStr (const std::string &name) const |
Return the status of a StateMachine as a human readable string. | |
std::vector< std::string > | getStateMachineList () const |
Get a list of all loaded StateMachines and their children. | |
const StateMachinePtr | getStateMachine (const std::string &name) const |
Get a pointer to a loaded StateMachine. | |
StateMachinePtr | getStateMachine (const std::string &name) |
Get a pointer to a loaded StateMachine. | |
int | execute (const std::string &code) |
Parse and execute a statement. | |
bool | eval (const std::string &code) |
Evaluate and run all statements in code. | |
bool | runScript (const std::string &filename) |
Run a script which is stored in a file. | |
virtual Functions | loadFunctions (const std::string &filename, bool do_throw) |
Load and execute a set of functions into the Program Processor for execution. | |
virtual Functions | loadFunctions (const std::string &code, const std::string &filename, bool do_throw) |
Load and execute a set of functions into the Program Processor for execution. | |
virtual bool | loadPrograms (const std::string &filename, bool do_throw) |
Load a set of programs into the Program Processor for execution. | |
virtual bool | loadPrograms (const std::string &code, const std::string &filename, bool do_throw) |
Load a set of programs into the Program Processor for execution. | |
virtual bool | unloadProgram (const std::string &name, bool do_throw) |
Unload a program from the Program Processor. | |
virtual int | getProgramLine (const std::string &name) const |
Get the current line of execution of a loaded program script. | |
virtual std::string | getProgramText (const std::string &name) const |
Get the original script description of a loaded program. | |
virtual bool | loadStateMachines (const std::string &filename, bool do_throw) |
Load a set of state machines into the StateMachineProcessor for execution. | |
virtual bool | loadStateMachines (const std::string &code, const std::string &filename, bool do_throw) |
Load a set of state machines into the StateMachineProcessor for execution. | |
virtual bool | unloadStateMachine (const std::string &name, bool do_throw) |
Unload a state machine from the StateMachineProcessor. | |
virtual std::string | getStateMachineText (const std::string &name) const |
Get the original script description of a loaded state machine. | |
virtual int | getStateMachineLine (const std::string &name) const |
Get the current line of execution of a loaded state machine script. | |
const std::string & | getName () const |
Returns the name of this service instance. | |
const std::string & | doc () const |
Returns a descriptive text for this service. | |
void | doc (const std::string &description) |
Sets the descriptive text for this service. | |
void | setName (const std::string &name) |
Changes the name of this service. | |
void | setOwner (TaskContext *new_owner) |
Sets the owning TaskContext that will execute the operations in this service. | |
void | setParent (shared_ptr new_parent) |
Sets the parent service in case this service is a sub-service. | |
shared_ptr | getParent () const |
The parent is the direct parent of this service. | |
virtual ProviderNames | getProviderNames () const |
Return a standard container which contains all the sub-service names of this Service. | |
TaskContext * | getOwner () const |
The owner is the top-level TaskContext owning this service (indirectly). | |
virtual bool | addService (shared_ptr obj) |
Add a new Service to this TaskContext. | |
virtual void | removeService (std::string const &service_name) |
Remove a previously added sub-service. | |
Service::shared_ptr | provides () |
Returns this Service. | |
Service::shared_ptr | provides (const std::string &service_name) |
Returns a sub-Service which resorts under this Service. | |
shared_ptr | getService (const std::string &service_name) |
Returns a shared pointer to strictly a sub-service. | |
Service * | getService () const |
Returns the service this interface belongs to. | |
bool | hasService (const std::string &service_name) |
Check if this service has the sub-service service_name. | |
std::vector< std::string > | getOperationNames () const |
Returns the names of all operations added to this interface. | |
bool | hasOperation (const std::string &name) const |
Query for the existence of a Operation in this interface. | |
bool | addLocalOperation (base::OperationBase &op) |
Add an Operation object to the operation interface. | |
boost::shared_ptr < base::DisposableInterface > | getLocalOperation (std::string name) |
Get a locally added operation from this interface. | |
OperationInterfacePart * | getOperation (std::string name) |
Get a previously added operation for use in a C++ OperationCaller object. | |
base::DataSourceBase::shared_ptr | getOperation (std::string name, const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const |
For internal use only. | |
void | removeOperation (const std::string &name) |
Removes a previously added operation. | |
bool | setOperationThread (std::string const &name, ExecutionThread et) |
Sets the thread of execution of a previously added operation. | |
template<class Signature > | |
Operation< Signature > & | addOperation (Operation< Signature > &op) |
Add an operation object to the interface. | |
template<class Func , class Service > | |
Operation< typename internal::GetSignature< Func > ::Signature > & | addOperation (const std::string name, Func func, Service *serv, ExecutionThread et=ClientThread) |
Add an operation to the interface by means of a C++ function. | |
template<class Func > | |
Operation< Func > & | addOperation (const std::string name, Func *func, ExecutionThread et=ClientThread) |
Add an operation to the interface by means of a C function. | |
template<class Signature > | |
Operation< Signature > & | addSynchronousOperation (Operation< Signature > &op) |
Add an operation object to the interface. | |
template<class Func , class Service > | |
Operation< typename internal::GetSignature< Func > ::Signature > & | addSynchronousOperation (const std::string name, Func func, Service *serv, ExecutionThread et=ClientThread) |
Add an operation to the synchronous interface by means of a function. | |
template<class Func , class ObjT > | |
Operation< typename internal::GetSignatureDS< Func > ::Signature > & | addOperationDS (const std::string &name, Func func, internal::DataSource< boost::shared_ptr< ObjT > > *sp, ExecutionThread et=ClientThread) |
For internal use only. | |
template<class Signature , class ObjT > | |
Operation< Signature > & | addOperationDS (internal::DataSource< boost::shared_ptr< ObjT > > *sp, Operation< Signature > &op) |
For internal use only. | |
internal::OperationCallerC | create (std::string name, ExecutionEngine *caller) |
Create a OperationCallerC object, a template-less operation invocation object. | |
bool | resetOperation (std::string name, base::OperationBase *impl) |
Reset the implementation of a operation. | |
std::vector< std::string > | getNames () const |
Get a list of all the names of the added operations. | |
bool | hasMember (const std::string &name) const |
Query if an operation is present. | |
int | getArity (const std::string &name) const |
Query the number of arguments of an operation. | |
int | getCollectArity (const std::string &name) const |
Query the collectable number of arguments of an operation. | |
bool | isSynchronous (const std::string &name) const |
Query if a given operation is limited to sychronous invocation (own component thread) only. | |
base::DataSourceBase::shared_ptr | produce (const std::string &name, const Arguments &args, ExecutionEngine *caller) const |
Produce a DataSource that call()s an operation. | |
base::DataSourceBase::shared_ptr | produceSend (const std::string &name, const Arguments &args, ExecutionEngine *caller) const |
Produce a DataSource that send()s an operation. | |
base::DataSourceBase::shared_ptr | produceHandle (const std::string &name) const |
Produce an AssignableDataSource that contains a SendHandle, fit for the operation. | |
base::DataSourceBase::shared_ptr | produceCollect (const std::string &name, const Arguments &args, internal::DataSource< bool >::shared_ptr blocking) const |
Produce a DataSource that collects a sent operation, The DataSource will return the SendStatus and store the results in the presented arguments. | |
Descriptions | getArgumentList (const std::string &name) const |
Get the names and descriptions of all arguments of an operation. | |
std::string | getResultType (const std::string &name) const |
Get the type name of the result type of an operation. | |
std::string | getDescription (const std::string &name) const |
Get the description of an operation. | |
void | add (const std::string &name, OperationInterfacePart *part) |
Add a new operation to the interface or replace an existing one. | |
void | remove (const std::string &name) |
Remove an added operation from the interface. | |
OperationInterfacePart * | getPart (const std::string &name) |
Get a previously added part of this factory. | |
bool | hasAttribute (const std::string &name) const |
Check if an attribute is present in this interface. | |
template<class T > | |
bool | addAttribute (const std::string &name, T &attr) |
Adds a variable of any type as read/write attribute to the configuration interface. | |
template<class T > | |
Attribute< T > & | addAttribute (const std::string &name, Attribute< T > &attr) |
Adds an existing attribute object to the configuration interface. | |
bool | addAttribute (base::AttributeBase &a) |
Add an base::AttributeBase which remains owned by the user. | |
template<class T > | |
bool | addConstant (const std::string &name, const T &cnst) |
Adds a variable of any type as read-only attribute to the configuration interface. | |
template<class T > | |
Constant< T > & | addConstant (const std::string &name, Constant< T > &cnst) |
Adds an existing constant object to the configuration interface. | |
bool | addConstant (base::AttributeBase &c) |
Add a Constant with a given value. | |
template<class T > | |
Property< T > & | addProperty (const std::string &name, T &prop) |
Adds a variable of any type as a property to the configuration interface. | |
template<class T > | |
Property< T > & | addProperty (const std::string &name, Property< T > &prop) |
Adds an existing property object to the configuration interface. | |
bool | addProperty (base::PropertyBase &pb) |
Add an base::PropertyBase as a property. | |
base::AttributeBase * | getAttribute (const std::string &name) const |
void | removeAttribute (const std::string &name) |
Remove an attribute from the repository. | |
base::AttributeBase * | getConstant (const std::string &name) const |
bool | hasProperty (const std::string &name) const |
Check if a property is present. | |
bool | removeProperty (base::PropertyBase &p) |
Remove a previously added Property and associated attribute. | |
base::PropertyBase * | getProperty (const std::string &name) const |
Get a Property with name name. | |
bool | setValue (base::AttributeBase *ab) |
Transfer the ownership of an attribute to the repository. | |
base::AttributeBase * | getValue (const std::string &name) const |
bool | removeValue (const std::string &name) |
Delete a value added with setValue from the repository. | |
ConfigurationInterface * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const |
Return a new copy of this repository with the copy operation semantics. | |
void | loadValues (AttributeObjects const &new_values) |
Adds these attributes to this repository. | |
AttributeObjects const & | getValues () const |
Returns all attributes in this repository. | |
AttributeNames | getAttributeNames () const |
Return the names of all attributes in this repository. | |
PropertyBag * | properties () |
Return a bag of all properties. | |
base::PortInterface & | addPort (const std::string &name, base::PortInterface &port) |
Name and add a Port to the interface of this task and add a Service with the same name of the port. | |
base::PortInterface & | addPort (base::PortInterface &port) |
Add a Port to the interface of this task and add a Service with the same name of the port. | |
base::InputPortInterface & | addEventPort (const std::string &name, base::InputPortInterface &port, SlotFunction callback=SlotFunction()) |
Name and add an Event triggering Port to the interface of this task and add a Service with the same name of the port. | |
base::InputPortInterface & | addEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction()) |
Add an Event triggering Port to the interface of this task and add a Service with the same name of the port. | |
void | removePort (const std::string &name) |
Remove a Port from this interface. | |
Ports | getPorts () const |
Get all ports of this interface. | |
PortNames | getPortNames () const |
Get all port names of this interface. | |
base::PortInterface * | getPort (const std::string &name) const |
Get an added port. | |
std::string | getPortDescription (const std::string &name) const |
Get the description of an added Port. | |
bool | setPortDescription (const std::string &name, const std::string description) |
Sets the description for the service of an added port. | |
base::PortInterface & | addLocalPort (base::PortInterface &port) |
Add a Port to this task without registering a service for it. | |
base::InputPortInterface & | addLocalEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction()) |
Add an Event triggering Port to this task without registering a service for it. | |
template<class Type > | |
Type * | getPortType (const std::string &name) |
Get a port of a specific type. | |
void | dataOnPort (base::PortInterface *port) |
Used by the input ports to notify this class of new data. | |
Script Program Commands | |
bool | startProgram (const std::string &name) |
Start a Program. | |
bool | stopProgram (const std::string &name) |
Stops the execution of a program. | |
bool | pauseProgram (const std::string &name) |
Pauses the execution of a running program. | |
bool | stepProgram (const std::string &name) |
Steps a single instruction of a paused program. | |
Script Program OperationCallers | |
virtual bool | hasProgram (const std::string &name) const |
Check if a program is loaded. | |
bool | isProgramRunning (const std::string &name) const |
Inspect if a loaded program is in the running state. | |
bool | isProgramPaused (const std::string &name) const |
Inspect if a loaded program is in the paused state. | |
bool | inProgramError (const std::string &name) const |
Inspect if a loaded program is in the error state. | |
Script State Machine Commands | |
bool | activateStateMachine (const std::string &name) |
Activate a previously loaded StateMachine. | |
bool | deactivateStateMachine (const std::string &name) |
Deactivate a stopped StateMachine. | |
bool | startStateMachine (const std::string &name) |
Start a previously activated StateMachine. | |
bool | pauseStateMachine (const std::string &name) |
Pause a previously activated StateMachine. | |
bool | stopStateMachine (const std::string &name) |
Stops the execution of a scripting::StateMachine and enters the Final_State. | |
bool | resetStateMachine (const std::string &name) |
Resets the execution of a scripting::StateMachine and enters the Initial_State. | |
bool | requestStateMachineState (const std::string &name, const std::string &state) |
Request a state change in a state machine. | |
Script State Machine OperationCallers | |
virtual bool | hasStateMachine (const std::string &name) const |
Check if a state machine is loaded. | |
bool | isStateMachineActive (const std::string &name) const |
Returns true if the state machine has been activated. | |
bool | isStateMachineRunning (const std::string &name) const |
Returns true if the state machine was successfully started. | |
bool | inStateMachineError (const std::string &name) const |
Returns true if the state machine is in error. | |
bool | isStateMachinePaused (const std::string &name) const |
Returns true if the state machine is paused. | |
std::string | getStateMachineState (const std::string &name) const |
Get the current state of a state machine. | |
bool | inStateMachineState (const std::string &name, const std::string &state) const |
Check if a state machine is in a given state. | |
Static Public Member Functions | |
static shared_ptr | Create (TaskContext *parent) |
Creates a ScriptingService object and registers the service to parent. | |
static Service::shared_ptr | Create (const std::string &name, TaskContext *owner=0) |
Creates a Service with a name and an owner. | |
Protected Types | |
typedef std::map< std::string, StateMachinePtr > | StateMap |
typedef StateMap::const_iterator | StateMapIt |
typedef std::map< std::string, ProgramInterfacePtr > | ProgMap |
typedef ProgMap::const_iterator | ProgMapIt |
typedef std::map< std::string, shared_ptr > | Services |
typedef std::map< std::string, base::OperationBase * > | SimpleOperations |
typedef std::vector < base::OperationBase * > | OperationList |
typedef std::map< std::string, OperationInterfacePart * > | map_t |
typedef std::vector < base::AttributeBase * > | map_t |
Protected Member Functions | |
bool | doExecute (const std::string &code) |
bool | evalInternal (const std::string &filename, const std::string &code) |
bool | doLoadPrograms (const std::string &filename) |
bool | doLoadProgramText (const std::string &code) |
bool | doUnloadProgram (const std::string &name) |
bool | doLoadStateMachines (const std::string &filename) |
bool | doLoadStateMachineText (const std::string &code) |
bool | doUnloadStateMachine (const std::string &name) |
void | createInterface (void) |
void | recursiveLoadStateMachine (StateMachinePtr sc) |
bool | recursiveCheckLoadStateMachine (StateMachinePtr sc) |
void | recursiveUnloadStateMachine (StateMachinePtr sc) |
bool | recursiveCheckUnloadStateMachine (StateMachinePtr si) |
bool | testOperation (base::OperationBase &op) |
bool | chkPtr (const std::string &where, const std::string &name, const void *ptr) |
bool | chkPtr (const std::string &where, const std::string &name, const void *ptr) |
Service * | createPortObject (const std::string &name) |
Create a Service through which one can access a Port. | |
Protected Attributes | |
StatementProcessor * | sproc |
StateMap | states |
ProgMap | programs |
bool | ZeroPeriodWarning |
This is a property of the Scripting service It is true by default If this is set to false, the warning log when loading a program or a state machine into a Component with a null period will not be printed. | |
Services | services |
the services we implement. | |
SimpleOperations | simpleoperations |
OperationList | ownedoperations |
std::string | mname |
std::string | mdescription |
TaskContext * | mowner |
shared_ptr | parent |
map_t | data |
map_t | values |
PropertyBag | bag |
Ports | mports |
All our ports. | |
Service * | mservice |
The parent Service. |
This interface allows to load program scripts and state machines and allows execution of code.
It keeps track of all loaded scripts of the parent component. It can be found as the scripting object of a TaskContext.
Definition at line 60 of file ScriptingService.hpp.
RTT::ScriptingService::ScriptingService | ( | TaskContext * | parent | ) |
Creates a ScriptingService object.
You need to add the service to parent yourself, or use Create().
Definition at line 70 of file ScriptingService.cpp.
References RTT::ConfigurationInterface::addProperty(), RTT::Service::doc(), and ZeroPeriodWarning.
bool RTT::ScriptingService::activateStateMachine | ( | const std::string & | name | ) |
Activate a previously loaded StateMachine.
name | The name of the StateMachine. |
Definition at line 868 of file ScriptingService.cpp.
References getStateMachine().
void OperationInterface::add | ( | const std::string & | name, |
OperationInterfacePart * | part | ||
) | [inherited] |
Add a new operation to the interface or replace an existing one.
name | The name of the operation |
part | A part which creates the operation. |
Definition at line 170 of file OperationInterface.cpp.
bool RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, |
T & | attr | ||
) | [inline, inherited] |
Adds a variable of any type as read/write attribute to the configuration interface.
An Alias is created which causes contents of the attr variable always to be in sync with the contents of the attribute object in the interface.
name | The name of this attribute |
attr | The variable that will be aliased. |
Definition at line 101 of file ConfigurationInterface.hpp.
Attribute<T>& RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, |
Attribute< T > & | attr | ||
) | [inline, inherited] |
Adds an existing attribute object to the configuration interface.
name | The name of this attribute. attr will be initialized with this name. |
attr | The attribute to add |
Definition at line 115 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::ready(), and RTT::base::AttributeBase::setName().
bool RTT::ConfigurationInterface::addAttribute | ( | base::AttributeBase & | a | ) | [inline, inherited] |
Add an base::AttributeBase which remains owned by the user.
This is a low-level function that can be used if you already created an Attribute object that does not belong yet to a service.
a | remains owned by the user, and becomes served by the repository. |
Definition at line 204 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::clone(), and RTT::base::AttributeBase::getDataSource().
bool RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, |
const T & | cnst | ||
) | [inline, inherited] |
Adds a variable of any type as read-only attribute to the configuration interface.
An Alias is created which causes contents of the attribute always to be in sync with the contents of cnst, but it can only be read through the interface.
name | The name of this attribute |
cnst | The variable that will be aliased. |
Definition at line 135 of file ConfigurationInterface.hpp.
Constant<T>& RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, |
Constant< T > & | cnst | ||
) | [inline, inherited] |
Adds an existing constant object to the configuration interface.
name | The name of this constant. cnst will be initialized with this name. |
cnst | The constant to add. If cnst has not been initialized, it will be initialized to T(). You can change it later-on using the Constant's API. |
Definition at line 150 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::ready(), and RTT::base::AttributeBase::setName().
bool RTT::ConfigurationInterface::addConstant | ( | base::AttributeBase & | c | ) | [inline, inherited] |
Add a Constant with a given value.
Definition at line 232 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::clone(), and RTT::base::AttributeBase::getDataSource().
base::InputPortInterface& RTT::DataFlowInterface::addEventPort | ( | const std::string & | name, |
base::InputPortInterface & | port, | ||
SlotFunction | callback = SlotFunction() |
||
) | [inline, inherited] |
Name and add an Event triggering Port to the interface of this task and add a Service with the same name of the port.
name | The name to give to the port. |
port | The port to add. |
callback | (Optional) provide a function which will be called asynchronously when new data arrives on this port. You can add more functions by using the port directly using base::PortInterface::getNewDataOnPort(). |
Definition at line 114 of file DataFlowInterface.hpp.
References RTT::base::PortInterface::setName().
InputPortInterface & RTT::DataFlowInterface::addEventPort | ( | base::InputPortInterface & | port, |
SlotFunction | callback = SlotFunction() |
||
) | [inherited] |
Add an Event triggering Port to the interface of this task and add a Service with the same name of the port.
When data arrives on this port your TaskContext will be woken up and updateHook will be executed.
port | The port to add. |
callback | (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port. |
Definition at line 93 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::addLocalEventPort(), RTT::Service::addService(), RTT::DataFlowInterface::createPortObject(), RTT::base::PortInterface::getName(), RTT::Service::hasService(), RTT::DataFlowInterface::mservice, and RTT::Service::removeService().
InputPortInterface & RTT::DataFlowInterface::addLocalEventPort | ( | base::InputPortInterface & | port, |
SlotFunction | callback = SlotFunction() |
||
) | [inherited] |
Add an Event triggering Port to this task without registering a service for it.
When data arrives on this port your TaskContext will be woken up and updateHook will be executed.
port | The port to add. |
callback | (Optional) provide a function which will be called when new data arrives on this port. The callback function will be called in sequence with updateHook(), so asynchronously with regard to the arrival of data on the port. |
Definition at line 127 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::addLocalPort(), RTT::base::PortInterface::getName(), RTT::Service::getName(), RTT::Service::getOwner(), RTT::DataFlowInterface::mservice, and RTT::base::InputPortInterface::signalInterface().
Referenced by RTT::DataFlowInterface::addEventPort().
bool RTT::Service::addLocalOperation | ( | base::OperationBase & | op | ) | [inherited] |
Add an Operation object to the operation interface.
This version of addOperation does not add the Operation object to the remote interface and only to the local, in-process C++ interface.
op | The Operation object to add |
Definition at line 171 of file Service.cpp.
References RTT::base::TaskCore::engine(), RTT::base::OperationBase::getImplementation(), RTT::base::OperationBase::getName(), RTT::Service::removeOperation(), and RTT::base::OperationBase::setOwner().
PortInterface & RTT::DataFlowInterface::addLocalPort | ( | base::PortInterface & | port | ) | [inherited] |
Add a Port to this task without registering a service for it.
If a port with the same name already exists, addPort will replace it with port and log a warning.
Definition at line 78 of file DataFlowInterface.cpp.
References RTT::base::PortInterface::getName(), RTT::DataFlowInterface::mports, RTT::DataFlowInterface::removePort(), and RTT::base::PortInterface::setInterface().
Referenced by RTT::DataFlowInterface::addLocalEventPort(), and RTT::DataFlowInterface::addPort().
Operation<Signature>& RTT::Service::addOperation | ( | Operation< Signature > & | op | ) | [inline, inherited] |
Add an operation object to the interface.
This version of addOperation exports an existing Operation object to the public interface of this component.
op | The operation object to add. |
Definition at line 297 of file Service.hpp.
References RTT::base::OperationBase::getName().
Referenced by RTT::marsh::MarshallingService::MarshallingService().
Operation< typename internal::GetSignature<Func>::Signature >& RTT::Service::addOperation | ( | const std::string | name, |
Func | func, | ||
Service * | serv, | ||
ExecutionThread | et = ClientThread |
||
) | [inline, inherited] |
Add an operation to the interface by means of a C++ function.
The function func must be a C++ member function and serv is the object having that function.
name | The name of the new operation |
func | A pointer to a function, for example, &Bar::foo (C++ class function). |
serv | A pointer to the object that will execute the function. |
et | The ExecutionThread choice: will the owning TaskContext of this service execute the function func in its own thread, or will the client's thread (the caller) execute func ? |
Definition at line 337 of file Service.hpp.
Operation< Func >& RTT::Service::addOperation | ( | const std::string | name, |
Func * | func, | ||
ExecutionThread | et = ClientThread |
||
) | [inline, inherited] |
Add an operation to the interface by means of a C function.
The function func must be a C function.
name | The name of the new operation |
func | A pointer to a C function, for example, &foo (or a static C++ class function). |
et | The ExecutionThread choice: will the owning TaskContext of this service execute the function func in its own thread, or will the client's thread (the caller) execute func ? |
Definition at line 358 of file Service.hpp.
Operation< typename internal::GetSignatureDS<Func>::Signature>& RTT::Service::addOperationDS | ( | const std::string & | name, |
Func | func, | ||
internal::DataSource< boost::shared_ptr< ObjT > > * | sp, | ||
ExecutionThread | et = ClientThread |
||
) | [inline, inherited] |
For internal use only.
The pointer of the object of which a member function must be invoked is stored in a internal::DataSource such that the pointer can change during program execution. Required in scripting for state machines.
Definition at line 395 of file Service.hpp.
Referenced by RTT::scripting::ProgramService::ProgramService().
Operation<Signature>& RTT::Service::addOperationDS | ( | internal::DataSource< boost::shared_ptr< ObjT > > * | sp, |
Operation< Signature > & | op | ||
) | [inline, inherited] |
For internal use only.
The pointer of the object of which a member function must be invoked is stored in a internal::DataSource such that the pointer can change during program execution. Required in scripting for state machines.
Definition at line 410 of file Service.hpp.
References RTT::base::OperationBase::getName().
base::PortInterface& RTT::DataFlowInterface::addPort | ( | const std::string & | name, |
base::PortInterface & | port | ||
) | [inline, inherited] |
Name and add a Port to the interface of this task and add a Service with the same name of the port.
name | The name to give to the port. |
port | The port to add. |
Definition at line 89 of file DataFlowInterface.hpp.
References RTT::base::PortInterface::setName().
PortInterface & RTT::DataFlowInterface::addPort | ( | base::PortInterface & | port | ) | [inherited] |
Add a Port to the interface of this task and add a Service with the same name of the port.
If a port or service with the name already exists, addPort will replace them with port and log a warning.
port | The port to add. |
Definition at line 59 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::addLocalPort(), RTT::Service::addService(), RTT::DataFlowInterface::createPortObject(), RTT::base::PortInterface::getName(), RTT::Service::hasService(), RTT::DataFlowInterface::mservice, and RTT::Service::removeService().
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, |
T & | prop | ||
) | [inline, inherited] |
Adds a variable of any type as a property to the configuration interface.
A Property is created which causes contents of the property always to be in sync with the contents of prop.
name | The name of this property |
prop | The variable that will be aliased. |
Definition at line 171 of file ConfigurationInterface.hpp.
Referenced by ScriptingService().
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, |
Property< T > & | prop | ||
) | [inline, inherited] |
Adds an existing property object to the configuration interface.
name | The name of this property. prop will be initialized with this name. |
prop | The property to add |
Definition at line 184 of file ConfigurationInterface.hpp.
References RTT::base::PropertyBase::ready(), and RTT::base::PropertyBase::setName().
bool RTT::ConfigurationInterface::addProperty | ( | base::PropertyBase & | pb | ) | [inherited] |
Add an base::PropertyBase as a property.
Definition at line 90 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
bool RTT::Service::addService | ( | Service::shared_ptr | obj | ) | [virtual, inherited] |
Add a new Service to this TaskContext.
obj | This object becomes owned by this TaskContext. |
Definition at line 81 of file Service.cpp.
References RTT::Service::services.
Referenced by RTT::DataFlowInterface::addEventPort(), and RTT::DataFlowInterface::addPort().
Operation<Signature>& RTT::Service::addSynchronousOperation | ( | Operation< Signature > & | op | ) | [inline, inherited] |
Add an operation object to the interface.
This version exports an existing Operation object to the synchronous interface of the component
op | The operation object to add. |
Definition at line 314 of file Service.hpp.
References RTT::base::OperationBase::getName().
Referenced by RTT::base::PortInterface::createPortObject().
Operation< typename internal::GetSignature<Func>::Signature >& RTT::Service::addSynchronousOperation | ( | const std::string | name, |
Func | func, | ||
Service * | serv, | ||
ExecutionThread | et = ClientThread |
||
) | [inline, inherited] |
Add an operation to the synchronous interface by means of a function.
The function func must be a C++ function.
name | The name of the new operation |
func | A pointer to a function, for example &Bar::foo (C++ class function). |
serv | A pointer to the object that will execute the function in case of a C++ class function, |
et | The ExecutionThread choice: will the owning TaskContext of this service execute the function func in its own thread, or will the client's thread (the caller) execute func ? |
Definition at line 381 of file Service.hpp.
ConfigurationInterface * RTT::ConfigurationInterface::copy | ( | std::map< const base::DataSourceBase *, base::DataSourceBase * > & | repl, |
bool | instantiate | ||
) | const [inherited] |
Return a new copy of this repository with the copy operation semantics.
instantiate | set to true if you want a copy which will upon any future copy return the same DataSources, thus 'fixating' or 'instantiating' the DataSources. |
Definition at line 60 of file ConfigurationInterface.cpp.
References RTT::ConfigurationInterface::setValue().
Referenced by loadFunctions(), loadPrograms(), loadStateMachines(), and runScript().
Service::shared_ptr RTT::Service::Create | ( | const std::string & | name, |
TaskContext * | owner = 0 |
||
) | [static, inherited] |
Creates a Service with a name and an owner.
Each service must be owned by a TaskContext and the owner can be set afterwards with setOwner.
name | The name of this service. |
owner | The TaskContext that will execute the operations of this service. |
Definition at line 52 of file Service.cpp.
References RTT::TaskContext::provides().
internal::OperationCallerC RTT::Service::create | ( | std::string | name, |
ExecutionEngine * | caller | ||
) | [inherited] |
Create a OperationCallerC object, a template-less operation invocation object.
This function is inferior to getOperation(std::string name).
name | The name of the operation |
Definition at line 259 of file Service.cpp.
References RTT::OperationInterface::getPart().
Service * RTT::DataFlowInterface::createPortObject | ( | const std::string & | name | ) | [protected, inherited] |
Create a Service through which one can access a Port.
name | The port name |
Definition at line 211 of file DataFlowInterface.cpp.
References RTT::base::PortInterface::createPortObject(), RTT::Service::doc(), RTT::DataFlowInterface::getPort(), and RTT::DataFlowInterface::getPortDescription().
Referenced by RTT::DataFlowInterface::addEventPort(), and RTT::DataFlowInterface::addPort().
bool RTT::ScriptingService::deactivateStateMachine | ( | const std::string & | name | ) |
Deactivate a stopped StateMachine.
name | The name of the StateMachine. |
Definition at line 876 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::scripting::ScriptingService::deleteProgram | ( | const std::string & | name | ) |
Completely discard a loaded Program.
program_unload_exception | if the program is not stopped or does not exist. |
bool RTT::ScriptingService::deleteStateMachine | ( | const std::string & | name | ) |
Delete a deactivated State Machine and all its children.
program_unload_exception | if the state machine or one of its children is still active. |
Definition at line 305 of file ScriptingService.cpp.
References unloadStateMachine().
bool RTT::ScriptingService::eval | ( | const std::string & | code | ) |
Evaluate and run all statements in code.
This function is in functionality equivalent to runScript, except that runScript takes a filename as an argument, while this function takes the contents of the script itself as an argument. All possible syntax may be used.
code | A list of statements, program/function definitions etc. which get evaluated in the context of this component |
parse_exception | and its derivatives for parse errors in code. |
Definition at line 595 of file ScriptingService.cpp.
int RTT::ScriptingService::execute | ( | const std::string & | code | ) |
Parse and execute a statement.
code | A single statement to execute. |
-1 | if the code could not be parsed. |
0 | if the code was an expression and could be executed. |
>0 | if the code was a command and is being executed. |
Definition at line 515 of file ScriptingService.cpp.
References RTT::scripting::StatementProcessor::execute().
OperationInterface::Descriptions OperationInterface::getArgumentList | ( | const std::string & | name | ) | const [inherited] |
Get the names and descriptions of all arguments of an operation.
name | The name of the operation |
name_not_found_exception |
Definition at line 146 of file OperationInterface.cpp.
int OperationInterface::getArity | ( | const std::string & | name | ) | const [inherited] |
Query the number of arguments of an operation.
These are the number of function arguments, not counting the return value.
name | The name of the operation |
Definition at line 77 of file OperationInterface.cpp.
int OperationInterface::getCollectArity | ( | const std::string & | name | ) | const [inherited] |
Query the collectable number of arguments of an operation.
These are the return value (if non void) and each non-const reference argument of the operation.
name | The name of the operation |
Definition at line 85 of file OperationInterface.cpp.
std::string OperationInterface::getDescription | ( | const std::string & | name | ) | const [inherited] |
Get the description of an operation.
name | The name of the operation |
name_not_found_exception |
Definition at line 162 of file OperationInterface.cpp.
boost::shared_ptr< base::DisposableInterface > RTT::Service::getLocalOperation | ( | std::string | name | ) | [inherited] |
Get a locally added operation from this interface.
Definition at line 194 of file Service.cpp.
References RTT::Service::hasOperation().
OperationInterfacePart * RTT::Service::getOperation | ( | std::string | name | ) | [inherited] |
Get a previously added operation for use in a C++ OperationCaller object.
Store the result of this function in a OperationCaller<Signature> object.
name | The name of the operation to retrieve. |
Definition at line 135 of file Service.cpp.
References RTT::Service::getName(), RTT::OperationInterface::getPart(), and RTT::OperationInterface::hasMember().
Referenced by RTT::Service::setOperationThread().
base::DataSourceBase::shared_ptr RTT::Service::getOperation | ( | std::string | name, |
const std::vector< base::DataSourceBase::shared_ptr > & | args, | ||
ExecutionEngine * | caller | ||
) | const [inline, inherited] |
For internal use only.
Get a previously added operation as a DataSource. This function is inferior to getOperation(std::string name)
name | The name of the operation |
args | The arguments of the operation as Data Sources. |
Definition at line 429 of file Service.hpp.
std::vector< std::string > RTT::Service::getOperationNames | ( | ) | const [inherited] |
Returns the names of all operations added to this interface.
Definition at line 218 of file Service.cpp.
TaskContext* RTT::Service::getOwner | ( | ) | const [inline, inherited] |
The owner is the top-level TaskContext owning this service (indirectly).
A Service can only belong to one TaskContext.
Reimplemented from RTT::DataFlowInterface.
Definition at line 171 of file Service.hpp.
Referenced by RTT::DataFlowInterface::addLocalEventPort(), RTT::DataFlowInterface::dataOnPort(), RTT::DataFlowInterface::getOwner(), loadProgram(), loadStateMachine(), RTT::DataFlowInterface::removePort(), and RTT::Service::setOperationThread().
OperationInterfacePart * OperationInterface::getPart | ( | const std::string & | name | ) | [inherited] |
Get a previously added part of this factory.
name |
Definition at line 188 of file OperationInterface.cpp.
Referenced by RTT::Service::create(), and RTT::Service::getOperation().
PortInterface * RTT::DataFlowInterface::getPort | ( | const std::string & | name | ) | const [inherited] |
Get an added port.
name | The port name |
Definition at line 184 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::TaskContext::connectPorts(), and RTT::DataFlowInterface::createPortObject().
std::string RTT::DataFlowInterface::getPortDescription | ( | const std::string & | name | ) | const [inherited] |
Get the description of an added Port.
name | The port name |
Definition at line 193 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::DataFlowInterface::createPortObject().
DataFlowInterface::PortNames RTT::DataFlowInterface::getPortNames | ( | ) | const [inherited] |
Get all port names of this interface.
Definition at line 175 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
DataFlowInterface::Ports RTT::DataFlowInterface::getPorts | ( | ) | const [inherited] |
Get all ports of this interface.
Definition at line 171 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::TaskContext::connectPorts(), and RTT::TaskContext::disconnect().
int RTT::ScriptingService::getProgramLine | ( | const std::string & | name | ) | const [virtual] |
Get the current line of execution of a loaded program script.
name | The name of the program. |
-1 | if the program does not exist. |
0 | if the program is not running. |
n | the line number if the program is executing. |
Definition at line 788 of file ScriptingService.cpp.
References getProgram().
string RTT::ScriptingService::getProgramText | ( | const std::string & | name | ) | const [virtual] |
Get the original script description of a loaded program.
name | The name of the program. |
Definition at line 793 of file ScriptingService.cpp.
References getProgram().
base::PropertyBase* RTT::ConfigurationInterface::getProperty | ( | const std::string & | name | ) | const [inline, inherited] |
Get a Property with name name.
name | The name of the property to search for. |
Definition at line 275 of file ConfigurationInterface.hpp.
std::string OperationInterface::getResultType | ( | const std::string & | name | ) | const [inherited] |
Get the type name of the result type of an operation.
name | The name of the operation |
name_not_found_exception |
Definition at line 154 of file OperationInterface.cpp.
Service* RTT::DataFlowInterface::getService | ( | ) | const [inline, inherited] |
Returns the service this interface belongs to.
The returned service is a service living in the component returned by getOwner() or in one of its sub-services.
Definition at line 193 of file DataFlowInterface.hpp.
Service::shared_ptr RTT::Service::getService | ( | const std::string & | service_name | ) | [inherited] |
Returns a shared pointer to strictly a sub-service.
This method will not return the this pointer when service_name equals "this".
Definition at line 128 of file Service.cpp.
References RTT::Service::services.
Referenced by RTT::DataFlowInterface::setPortDescription().
int RTT::ScriptingService::getStateMachineLine | ( | const std::string & | name | ) | const [virtual] |
Get the current line of execution of a loaded state machine script.
name | The name of the state machine. |
-1 | if the state machine does not exist. |
0 | if the state machine is not running. |
n | the line number if the state machine is executing. |
Definition at line 807 of file ScriptingService.cpp.
References getStateMachine().
string RTT::ScriptingService::getStateMachineState | ( | const std::string & | name | ) | const |
Get the current state of a state machine.
name | The name of the StateMachine. |
Definition at line 940 of file ScriptingService.cpp.
References getStateMachine().
string RTT::ScriptingService::getStateMachineText | ( | const std::string & | name | ) | const [virtual] |
Get the original script description of a loaded state machine.
name | The name of the state machine. |
Definition at line 802 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::Service::hasOperation | ( | const std::string & | name | ) | const [inherited] |
Query for the existence of a Operation in this interface.
Definition at line 224 of file Service.cpp.
Referenced by RTT::Service::getLocalOperation(), RTT::Service::removeOperation(), RTT::Service::resetOperation(), and RTT::Service::setOperationThread().
bool RTT::ScriptingService::hasProgram | ( | const std::string & | name | ) | const [virtual] |
Check if a program is loaded.
name | The name of the program. |
Definition at line 784 of file ScriptingService.cpp.
bool RTT::ScriptingService::hasStateMachine | ( | const std::string & | name | ) | const [virtual] |
Check if a state machine is loaded.
name | The name of the state machine. |
Definition at line 798 of file ScriptingService.cpp.
bool RTT::ScriptingService::inProgramError | ( | const std::string & | name | ) | const |
Inspect if a loaded program is in the error state.
name | The name of the Program. |
Definition at line 836 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::inStateMachineError | ( | const std::string & | name | ) | const |
Returns true if the state machine is in error.
name | The name of the StateMachine. |
Definition at line 932 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::inStateMachineState | ( | const std::string & | name, |
const std::string & | state | ||
) | const |
Check if a state machine is in a given state.
name | The name of the StateMachine. |
state | The state to enter. |
Definition at line 956 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::isProgramPaused | ( | const std::string & | name | ) | const |
Inspect if a loaded program is in the paused state.
name | The name of the Program. |
Definition at line 828 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::isProgramRunning | ( | const std::string & | name | ) | const |
Inspect if a loaded program is in the running state.
name | The name of the Program. |
Definition at line 820 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::isStateMachineActive | ( | const std::string & | name | ) | const |
Returns true if the state machine has been activated.
name | The name of the StateMachine. |
Definition at line 916 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::isStateMachinePaused | ( | const std::string & | name | ) | const |
Returns true if the state machine is paused.
name | The name of the StateMachine. |
Definition at line 908 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::isStateMachineRunning | ( | const std::string & | name | ) | const |
Returns true if the state machine was successfully started.
name | The name of the StateMachine. |
Definition at line 924 of file ScriptingService.cpp.
References getStateMachine().
bool OperationInterface::isSynchronous | ( | const std::string & | name | ) | const [inherited] |
Query if a given operation is limited to sychronous invocation (own component thread) only.
Definition at line 93 of file OperationInterface.cpp.
ScriptingService::Functions RTT::ScriptingService::loadFunctions | ( | const std::string & | filename, |
bool | do_throw | ||
) | [virtual] |
Load and execute a set of functions into the Program Processor for execution.
filename | The file to load |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 521 of file ScriptingService.cpp.
References RTT::ConfigurationInterface::copy(), and RTT::Logger::log().
ScriptingService::Functions RTT::ScriptingService::loadFunctions | ( | const std::string & | code, |
const std::string & | filename, | ||
bool | do_throw | ||
) | [virtual] |
Load and execute a set of functions into the Program Processor for execution.
code | A string containing the function definitions. |
filename | The file name to use in the error messages. |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 537 of file ScriptingService.cpp.
References RTT::base::TaskCore::engine(), RTT::Logger::log(), RTT::Logger::nl(), RTT::scripting::Parser::parseFunction(), and RTT::ExecutionEngine::runFunction().
bool RTT::ScriptingService::loadProgram | ( | ProgramInterfacePtr | pi | ) |
Load a new Program.
The Processor takes full ownership and will delete it upon destruction.
program_load_exception | if a program with the same name already exists. |
Definition at line 359 of file ScriptingService.cpp.
References RTT::base::TaskCore::engine(), RTT::Service::getOwner(), RTT::ExecutionEngine::runFunction(), and ZeroPeriodWarning.
Referenced by loadPrograms().
bool RTT::ScriptingService::loadPrograms | ( | const std::string & | filename, |
bool | do_throw | ||
) | [virtual] |
Load a set of programs into the Program Processor for execution.
The programs are just loaded, not started yet.
filename | The file to load |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 614 of file ScriptingService.cpp.
References RTT::ConfigurationInterface::copy(), and RTT::Logger::log().
bool RTT::ScriptingService::loadPrograms | ( | const std::string & | code, |
const std::string & | filename, | ||
bool | do_throw | ||
) | [virtual] |
Load a set of programs into the Program Processor for execution.
The programs are just loaded, not started yet.
code | A string containing the function definitions. |
filename | The file name to use in the error messages. |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 630 of file ScriptingService.cpp.
References loadProgram(), RTT::Logger::log(), RTT::Logger::nl(), and RTT::scripting::Parser::parseProgram().
bool RTT::ScriptingService::loadStateMachine | ( | StateMachinePtr | sc | ) |
Load a new State Machine and all its children.
program_load_exception | if a state machine with the same name already exists. |
Definition at line 184 of file ScriptingService.cpp.
References RTT::Service::getOwner(), and ZeroPeriodWarning.
Referenced by loadStateMachines().
bool RTT::ScriptingService::loadStateMachines | ( | const std::string & | filename, |
bool | do_throw | ||
) | [virtual] |
Load a set of state machines into the StateMachineProcessor for execution.
The state machines are just loaded, not started yet.
filename | The file to load |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 699 of file ScriptingService.cpp.
References RTT::ConfigurationInterface::copy(), and RTT::Logger::log().
bool RTT::ScriptingService::loadStateMachines | ( | const std::string & | code, |
const std::string & | filename, | ||
bool | do_throw | ||
) | [virtual] |
Load a set of state machines into the StateMachineProcessor for execution.
The state machines are just loaded, not started yet.
code | A string containing the function definitions. |
filename | The file name to use in the error messages. |
do_throw | Set to yes to cause the parse errors to be thrown instead of being printed to the Logger interface. |
Definition at line 715 of file ScriptingService.cpp.
References loadStateMachine(), RTT::Logger::log(), RTT::Logger::nl(), and RTT::scripting::Parser::parseStateMachine().
bool RTT::ScriptingService::pauseProgram | ( | const std::string & | name | ) |
Pauses the execution of a running program.
name | The name of the Program. |
Definition at line 852 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::pauseStateMachine | ( | const std::string & | name | ) |
Pause a previously activated StateMachine.
name | The name of the StateMachine. |
Definition at line 892 of file ScriptingService.cpp.
References getStateMachine().
base::DataSourceBase::shared_ptr OperationInterface::produce | ( | const std::string & | name, |
const Arguments & | args, | ||
ExecutionEngine * | caller | ||
) | const [inherited] |
Produce a DataSource that call()s an operation.
The DataSource will return the result of call().
name | The name of the operation |
args | The arguments filled in as data sources. |
Definition at line 105 of file OperationInterface.cpp.
base::DataSourceBase::shared_ptr OperationInterface::produceCollect | ( | const std::string & | name, |
const Arguments & | args, | ||
internal::DataSource< bool >::shared_ptr | blocking | ||
) | const [inherited] |
Produce a DataSource that collects a sent operation, The DataSource will return the SendStatus and store the results in the presented arguments.
Note that this function takes most of the time less arguments than its companions.
name | The name of the operation |
args | The arguments filled in as data sources. |
blocking | Set to true to block on the result. |
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Definition at line 129 of file OperationInterface.cpp.
base::DataSourceBase::shared_ptr OperationInterface::produceHandle | ( | const std::string & | name | ) | const [inherited] |
Produce an AssignableDataSource that contains a SendHandle, fit for the operation.
The DataSource will return the SendHandle.
name | The name of the operation |
args | The arguments filled in as data sources. |
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Definition at line 121 of file OperationInterface.cpp.
base::DataSourceBase::shared_ptr OperationInterface::produceSend | ( | const std::string & | name, |
const Arguments & | args, | ||
ExecutionEngine * | caller | ||
) | const [inherited] |
Produce a DataSource that send()s an operation.
The DataSource will return the SendHandle of that operation.
name | The name of the operation |
args | The arguments filled in as data sources. |
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Definition at line 113 of file OperationInterface.cpp.
Service::shared_ptr RTT::Service::provides | ( | ) | [inherited] |
Returns this Service.
Definition at line 105 of file Service.cpp.
Referenced by RTT::Service::provides().
Service::shared_ptr RTT::Service::provides | ( | const std::string & | service_name | ) | [inherited] |
Returns a sub-Service which resorts under this Service.
service_name | The name of the sub-service. |
Definition at line 115 of file Service.cpp.
References RTT::Service::provides(), and RTT::Service::services.
void OperationInterface::remove | ( | const std::string & | name | ) | [inherited] |
Remove an added operation from the interface.
name | The name of the operation |
Definition at line 178 of file OperationInterface.cpp.
Referenced by RTT::Service::removeOperation().
void RTT::DataFlowInterface::removePort | ( | const std::string & | name | ) | [inherited] |
Remove a Port from this interface.
This will remove all connections and callbacks assosiated with this port.
port | The port to remove. |
Definition at line 155 of file DataFlowInterface.cpp.
References RTT::Service::getOwner(), RTT::DataFlowInterface::mports, RTT::DataFlowInterface::mservice, and RTT::Service::removeService().
Referenced by RTT::DataFlowInterface::addLocalPort().
bool RTT::ConfigurationInterface::removeProperty | ( | base::PropertyBase & | p | ) | [inherited] |
Remove a previously added Property and associated attribute.
Definition at line 129 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
void RTT::Service::removeService | ( | std::string const & | service_name | ) | [virtual, inherited] |
Remove a previously added sub-service.
the | name of the service to remove. |
Definition at line 96 of file Service.cpp.
References RTT::Service::services.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), RTT::Service::clear(), RTT::DataFlowInterface::clear(), and RTT::DataFlowInterface::removePort().
bool RTT::ScriptingService::requestStateMachineState | ( | const std::string & | name, |
const std::string & | state | ||
) |
Request a state change in a state machine.
name | The name of the StateMachine. |
state | The state to enter. |
Definition at line 948 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::resetStateMachine | ( | const std::string & | name | ) |
Resets the execution of a scripting::StateMachine and enters the Initial_State.
name | The name of the StateMachine. |
Definition at line 964 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::runScript | ( | const std::string & | filename | ) |
Run a script which is stored in a file.
filename | The local file to load and execute |
parse_exception | and its derivatives for parse errors in code. |
Definition at line 577 of file ScriptingService.cpp.
References RTT::ConfigurationInterface::copy(), and RTT::Logger::log().
bool RTT::Service::setOperationThread | ( | std::string const & | name, |
ExecutionThread | et | ||
) | [inherited] |
Sets the thread of execution of a previously added operation.
Only the component itself should modify this property. Don't call this function from outside the component, it has unspecified behaviour when not called from within one of the member functions or a service of the current component.
This function is typically used to change the ExecutionThread of the standard component hooks such as startHook(), configureHook() etc. which all have the ClientThread policy by default.
name | The name of the operation to modify. For example, "start". |
et | The ExecutionThread type in which the function of the operation will be executed, being OwnThread or ClientThread. |
Definition at line 153 of file Service.cpp.
References RTT::OperationInterfacePart::getLocalOperation(), RTT::Service::getOperation(), RTT::Service::getOwner(), RTT::Service::hasOperation(), and RTT::base::OperationCallerInterface::setThread().
bool RTT::DataFlowInterface::setPortDescription | ( | const std::string & | name, |
const std::string | description | ||
) | [inherited] |
Sets the description for the service of an added port.
It's prefered to use getPort(name)->doc(description) instead of this method, since this function only updates the documentation of the service representing this port, and not the documentation stored in the port.
name | The port name |
description | The new description for this port's service |
Definition at line 202 of file DataFlowInterface.cpp.
References RTT::Service::getService(), and RTT::DataFlowInterface::mservice.
Referenced by RTT::base::PortInterface::doc().
bool RTT::ConfigurationInterface::setValue | ( | base::AttributeBase * | ab | ) | [inherited] |
Transfer the ownership of an attribute to the repository.
ab | The attribute which becomes owned by this repository. |
Definition at line 78 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getDataSource(), and RTT::base::AttributeBase::getName().
Referenced by RTT::ConfigurationInterface::copy().
bool RTT::ScriptingService::startProgram | ( | const std::string & | name | ) |
Start a Program.
name | The name of the Program. |
Definition at line 812 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::startStateMachine | ( | const std::string & | name | ) |
Start a previously activated StateMachine.
name | The name of the StateMachine. |
Definition at line 884 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::stepProgram | ( | const std::string & | name | ) |
Steps a single instruction of a paused program.
name | The name of the Program. |
Definition at line 860 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::stopProgram | ( | const std::string & | name | ) |
Stops the execution of a program.
name | The name of the Program. |
Definition at line 844 of file ScriptingService.cpp.
References getProgram().
bool RTT::ScriptingService::stopStateMachine | ( | const std::string & | name | ) |
Stops the execution of a scripting::StateMachine and enters the Final_State.
name | The name of the StateMachine. |
Definition at line 900 of file ScriptingService.cpp.
References getStateMachine().
bool RTT::ScriptingService::unloadProgram | ( | const std::string & | name | ) |
Unload a program from this processor.
program_unload_exception | if the program is not stopped or does not exist. |
Definition at line 382 of file ScriptingService.cpp.
References RTT::base::TaskCore::engine(), and RTT::ExecutionEngine::removeFunction().
Referenced by clear(), and unloadProgram().
bool RTT::ScriptingService::unloadProgram | ( | const std::string & | name, |
bool | do_throw | ||
) | [virtual] |
Unload a program from the Program Processor.
name | The name of the loaded program. |
do_throw | Set to yes to cause the unloading errors to be thrown instead of being printed to the Logger interface. |
Definition at line 680 of file ScriptingService.cpp.
References RTT::Logger::log(), RTT::Logger::nl(), and unloadProgram().
bool RTT::ScriptingService::unloadStateMachine | ( | const std::string & | name | ) |
Unload a deactivated State Machine and all its children.
program_unload_exception | if the state machine or one of its children is still active. |
Definition at line 245 of file ScriptingService.cpp.
Referenced by clear(), deleteStateMachine(), and unloadStateMachine().
bool RTT::ScriptingService::unloadStateMachine | ( | const std::string & | name, |
bool | do_throw | ||
) | [virtual] |
Unload a state machine from the StateMachineProcessor.
name | The name of the loaded program. |
do_throw | Set to yes to cause the unloading errors to be thrown instead of being printed to the Logger interface. |
Definition at line 766 of file ScriptingService.cpp.
References RTT::Logger::log(), RTT::Logger::nl(), and unloadStateMachine().
Service* RTT::DataFlowInterface::mservice [protected, inherited] |
The parent Service.
May be null in exceptional cases.
Definition at line 262 of file DataFlowInterface.hpp.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addLocalEventPort(), RTT::DataFlowInterface::addPort(), RTT::DataFlowInterface::clear(), RTT::DataFlowInterface::dataOnPort(), RTT::DataFlowInterface::getOwner(), RTT::DataFlowInterface::removePort(), RTT::Service::Service(), and RTT::DataFlowInterface::setPortDescription().
bool RTT::scripting::ScriptingService::ZeroPeriodWarning [protected] |
This is a property of the Scripting service It is true by default If this is set to false, the warning log when loading a program or a state machine into a Component with a null period will not be printed.
Be sure you have something else triggering periodically your Component activity unless your script may not work.
Definition at line 583 of file ScriptingService.hpp.
Referenced by loadProgram(), loadStateMachine(), and ScriptingService().