Orocos Real-Time Toolkit  2.9.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
RTT::scripting::ScriptingService Class Reference

This interface allows to load program scripts and state machines and allows execution of code. More...

#include <rtt/scripting/ScriptingService.hpp>

Inheritance diagram for RTT::scripting::ScriptingService:
RTT::Service RTT::OperationInterface RTT::ConfigurationInterface RTT::DataFlowInterface

Public Types

typedef boost::shared_ptr< ScriptingServiceshared_ptr
 
typedef ProgramInterface::Status ProgramStatus
 
typedef scripting::StateMachine::Status StateMachineStatus
 
typedef std::vector< ProgramInterfacePtrFunctions
 List of executed functions. More...
 
typedef OperationInterface Factory
 
typedef boost::shared_ptr< const Serviceshared_constptr
 
typedef std::vector< std::string > ProviderNames
 
typedef std::vector< base::DataSourceBase::shared_ptrArguments
 The arguments for an operation. More...
 
typedef std::vector< ArgumentDescriptionDescriptions
 The descriptions of an argumentlist. More...
 
typedef std::vector< std::string > AttributeNames
 A vector containing the names of all attribute objects in this repository. More...
 
typedef std::vector< base::AttributeBase * > AttributeObjects
 A vector containing pointers to all attribute objects stored in this repository. More...
 
typedef std::vector< base::PortInterface * > Ports
 A sequence of pointers to ports. More...
 
typedef std::vector< std::string > PortNames
 A sequence of names of ports. More...
 
typedef boost::function< void(base::PortInterface *)> SlotFunction
 

Public Member Functions

 ScriptingService (TaskContext *parent)
 Creates a ScriptingService object. More...
 
virtual ~ScriptingService ()
 
bool loadProgram (ProgramInterfacePtr pi)
 Load a new Program. More...
 
bool deleteProgram (const std::string &name)
 Completely discard a loaded Program. More...
 
bool unloadProgram (const std::string &name)
 Unload a program from this processor. More...
 
void clear ()
 Stop and unload all program scripts. More...
 
ProgramStatus::ProgramStatus getProgramStatus (const std::string &name) const
 Return the status of a Program. More...
 
std::string getProgramStatusStr (const std::string &name) const
 Return the status of a Program as a human readable string. More...
 
std::vector< std::string > getProgramList () const
 Get a list of all loaded Programs. More...
 
const ProgramInterfacePtr getProgram (const std::string &name) const
 Get a pointer to a loaded Program. More...
 
ProgramInterfacePtr getProgram (const std::string &name)
 
bool loadStateMachine (StateMachinePtr sc)
 Load a new State Machine and all its children. More...
 
bool unloadStateMachine (const std::string &name)
 Unload a deactivated State Machine and all its children. More...
 
bool deleteStateMachine (const std::string &name)
 Delete a deactivated State Machine and all its children. More...
 
StateMachineStatus::StateMachineStatus getStateMachineStatus (const std::string &name) const
 Return the status of a StateMachine. More...
 
std::string getStateMachineStatusStr (const std::string &name) const
 Return the status of a StateMachine as a human readable string. More...
 
std::vector< std::string > getStateMachineList () const
 Get a list of all loaded StateMachines and their children. More...
 
const StateMachinePtr getStateMachine (const std::string &name) const
 Get a pointer to a loaded StateMachine. More...
 
StateMachinePtr getStateMachine (const std::string &name)
 Get a pointer to a loaded StateMachine. More...
 
int execute (const std::string &code)
 Parse and execute a statement. More...
 
bool eval (const std::string &code)
 Evaluate and run all statements in code. More...
 
bool runScript (const std::string &filename)
 Run a script which is stored in a file. More...
 
virtual Functions loadFunctions (const std::string &filename, bool do_throw)
 Load and execute a set of functions into the Program Processor for execution. More...
 
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. More...
 
virtual bool loadPrograms (const std::string &filename, bool do_throw)
 Load a set of programs into the Program Processor for execution. More...
 
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. More...
 
virtual bool unloadProgram (const std::string &name, bool do_throw)
 Unload a program from the Program Processor. More...
 
virtual int getProgramLine (const std::string &name) const
 Get the current line of execution of a loaded program script. More...
 
virtual std::string getProgramText (const std::string &name) const
 Get the original script description of a loaded program. More...
 
virtual bool loadStateMachines (const std::string &filename, bool do_throw)
 Load a set of state machines into the StateMachineProcessor for execution. More...
 
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. More...
 
virtual bool unloadStateMachine (const std::string &name, bool do_throw)
 Unload a state machine from the StateMachineProcessor. More...
 
virtual std::string getStateMachineText (const std::string &name) const
 Get the original script description of a loaded state machine. More...
 
virtual int getStateMachineLine (const std::string &name) const
 Get the current line of execution of a loaded state machine script. More...
 
const std::string & getName () const
 Returns the name of this service instance. More...
 
const std::string & doc () const
 Returns a descriptive text for this service. More...
 
void doc (const std::string &description)
 Sets the descriptive text for this service. More...
 
void setName (const std::string &name)
 Changes the name of this service. More...
 
void setOwner (TaskContext *new_owner)
 Sets the owning TaskContext that will execute the operations in this service. More...
 
void setParent (shared_ptr new_parent)
 Sets the parent service in case this service is a sub-service. More...
 
shared_ptr getParent () const
 The parent is the direct parent of this service. More...
 
virtual ProviderNames getProviderNames () const
 Return a standard container which contains all the sub-service names of this Service. More...
 
TaskContextgetOwner () const
 The owner is the top-level TaskContext owning this service (indirectly). More...
 
ExecutionEnginegetOwnerExecutionEngine () const
 Return the execution engine of this service owner. More...
 
virtual bool addService (shared_ptr obj)
 Add a new sub-service to this Service. More...
 
virtual void removeService (std::string const &service_name)
 Remove a previously added sub-service, potentially freeing it (and this) from memory. More...
 
Service::shared_ptr provides ()
 Returns this Service, unless no shared_ptr yet exists. More...
 
Service::shared_ptr provides (const std::string &service_name)
 Returns a sub-Service which resorts under this Service, creating a new one if it does not yet exists. More...
 
shared_ptr getService (const std::string &service_name)
 Returns a shared pointer to strictly a sub-service of a null pointer if !hasService(service_name). More...
 
ServicegetService () const
 Returns the service this interface belongs to. More...
 
bool hasService (const std::string &service_name)
 Check if this service has the sub-service service_name. More...
 
std::vector< std::string > getOperationNames () const
 Returns the names of all operations added to this interface. More...
 
bool hasOperation (const std::string &name) const
 Query for the existence of a Operation in this interface. More...
 
bool addLocalOperation (base::OperationBase &op)
 Add an Operation object to the operation interface. More...
 
boost::shared_ptr< base::DisposableInterfacegetLocalOperation (std::string name)
 Get a locally added operation from this interface. More...
 
OperationInterfacePartgetOperation (std::string name)
 Get a previously added operation for use in a C++ OperationCaller object. More...
 
base::DataSourceBase::shared_ptr getOperation (std::string name, const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
 For internal use only. More...
 
void removeOperation (const std::string &name)
 Removes a previously added operation. More...
 
bool setOperationThread (std::string const &name, ExecutionThread et)
 Sets the thread of execution of a previously added operation. More...
 
template<class Signature >
Operation< Signature > & addOperation (Operation< Signature > &op)
 Add an operation object to the interface. More...
 
template<class Func , class Class >
Operation< typename internal::GetSignature< Func >::Signature > & addOperation (const std::string name, Func func, Class *obj, ExecutionThread et=ClientThread)
 Add an operation to the interface by means of a C++ Class member function. More...
 
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 free C/C++ function. More...
 
template<class Signature >
Operation< Signature > & addSynchronousOperation (Operation< Signature > &op)
 Add an operation object to the interface. More...
 
template<class Func , class Class >
Operation< typename internal::GetSignature< Func >::Signature > & addSynchronousOperation (const std::string name, Func func, Class *obj, ExecutionThread et=ClientThread)
 Add an operation to the synchronous interface by means of a function. More...
 
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. More...
 
template<class Signature , class ObjT >
Operation< Signature > & addOperationDS (internal::DataSource< boost::shared_ptr< ObjT > > *sp, Operation< Signature > &op)
 For internal use only. More...
 
internal::OperationCallerC create (std::string name, ExecutionEngine *caller)
 Create a OperationCallerC object, a template-less operation invocation object. More...
 
bool resetOperation (std::string name, base::OperationBase *impl)
 Reset the implementation of a operation. More...
 
std::vector< std::string > getNames () const
 Get a list of all the names of the added operations. More...
 
bool hasMember (const std::string &name) const
 Query if an operation is present. More...
 
int getArity (const std::string &name) const
 Query the number of arguments of an operation. More...
 
int getCollectArity (const std::string &name) const
 Query the collectable number of arguments of an operation. More...
 
bool isSynchronous (const std::string &name) const
 Query if a given operation is limited to sychronous invocation (own component thread) only. More...
 
base::DataSourceBase::shared_ptr produce (const std::string &name, const Arguments &args, ExecutionEngine *caller) const
 Produce a DataSource that call()s an operation. More...
 
base::DataSourceBase::shared_ptr produceSend (const std::string &name, const Arguments &args, ExecutionEngine *caller) const
 Produce a DataSource that send()s an operation. More...
 
base::DataSourceBase::shared_ptr produceHandle (const std::string &name) const
 Produce an AssignableDataSource that contains a SendHandle, fit for the operation. More...
 
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. More...
 
Descriptions getArgumentList (const std::string &name) const
 Get the names and descriptions of all arguments of an operation. More...
 
std::string getResultType (const std::string &name) const
 Get the type name of the result type of an operation. More...
 
std::string getDescription (const std::string &name) const
 Get the description of an operation. More...
 
void add (const std::string &name, OperationInterfacePart *part)
 Add a new operation to the interface or replace an existing one. More...
 
void remove (const std::string &name)
 Remove an added operation from the interface. More...
 
OperationInterfacePartgetPart (const std::string &name)
 Get a previously added part of this factory. More...
 
bool hasAttribute (const std::string &name) const
 Check if an attribute is present in this interface. More...
 
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. More...
 
template<class T >
Attribute< T > & addAttribute (const std::string &name, Attribute< T > &attr)
 Adds an existing attribute object to the configuration interface. More...
 
bool addAttribute (base::AttributeBase &a)
 Add an base::AttributeBase which remains owned by the user. More...
 
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. More...
 
template<class T >
Constant< T > & addConstant (const std::string &name, Constant< T > &cnst)
 Adds an existing constant object to the configuration interface. More...
 
bool addConstant (base::AttributeBase &c)
 Add a Constant with a given value. More...
 
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. More...
 
template<class T >
Property< T > & addProperty (const std::string &name, Property< T > &prop)
 Adds an existing property object to the configuration interface. More...
 
bool addProperty (base::PropertyBase &pb)
 Add an base::PropertyBase as a property. More...
 
base::AttributeBasegetAttribute (const std::string &name) const
 
void removeAttribute (const std::string &name)
 Remove an attribute from the repository. More...
 
base::AttributeBasegetConstant (const std::string &name) const
 
bool hasProperty (const std::string &name) const
 Check if a property is present. More...
 
bool removeProperty (base::PropertyBase &p)
 Remove a previously added Property and associated attribute. More...
 
base::PropertyBasegetProperty (const std::string &name) const
 Get a Property with name name. More...
 
bool setValue (base::AttributeBase *ab)
 Transfer the ownership of an attribute to the repository. More...
 
base::AttributeBasegetValue (const std::string &name) const
 
bool removeValue (const std::string &name)
 Delete a value added with setValue from the repository. More...
 
ConfigurationInterfacecopy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const
 Return a new copy of this repository with the copy operation semantics. More...
 
void loadValues (AttributeObjects const &new_values)
 Adds these attributes to this repository. More...
 
AttributeObjects const & getValues () const
 Returns all attributes in this repository. More...
 
AttributeNames getAttributeNames () const
 Return the names of all attributes in this repository. More...
 
PropertyBagproperties ()
 Return a bag of all properties. More...
 
base::PortInterfaceaddPort (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. More...
 
base::PortInterfaceaddPort (base::PortInterface &port)
 Add a Port to the interface of this task and add a Service with the same name of the port. More...
 
base::InputPortInterfaceaddEventPort (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. More...
 
base::InputPortInterfaceaddEventPort (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. More...
 
void removePort (const std::string &name)
 Remove a Port from this interface. More...
 
Ports getPorts () const
 Get all ports of this interface. More...
 
PortNames getPortNames () const
 Get all port names of this interface. More...
 
base::PortInterfacegetPort (const std::string &name) const
 Get an added port. More...
 
std::string getPortDescription (const std::string &name) const
 Get the description of an added Port. More...
 
bool setPortDescription (const std::string &name, const std::string description)
 Sets the description for the service of an added port. More...
 
base::PortInterfaceaddLocalPort (base::PortInterface &port)
 Add a Port to this task without registering a service for it. More...
 
base::InputPortInterfaceaddLocalEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 Add an Event triggering Port to this task without registering a service for it. More...
 
void removeLocalPort (const std::string &name)
 Remove a locally added Port from this interface. More...
 
template<class Type >
Type * getPortType (const std::string &name)
 Get a port of a specific type. More...
 
void dataOnPort (base::PortInterface *port)
 Used by the input ports to notify this class of new data. More...
 
Script Program Commands
bool startProgram (const std::string &name)
 Start a Program. More...
 
bool stopProgram (const std::string &name)
 Stops the execution of a program. More...
 
bool pauseProgram (const std::string &name)
 Pauses the execution of a running program. More...
 
bool stepProgram (const std::string &name)
 Steps a single instruction of a paused program. More...
 
Script Program OperationCallers
virtual bool hasProgram (const std::string &name) const
 Check if a program is loaded. More...
 
bool isProgramRunning (const std::string &name) const
 Inspect if a loaded program is in the running state. More...
 
bool isProgramPaused (const std::string &name) const
 Inspect if a loaded program is in the paused state. More...
 
bool inProgramError (const std::string &name) const
 Inspect if a loaded program is in the error state. More...
 
Script State Machine Commands
bool activateStateMachine (const std::string &name)
 Activate a previously loaded StateMachine. More...
 
bool deactivateStateMachine (const std::string &name)
 Deactivate a stopped StateMachine. More...
 
bool startStateMachine (const std::string &name)
 Start a previously activated StateMachine. More...
 
bool pauseStateMachine (const std::string &name)
 Pause a previously activated StateMachine. More...
 
bool stopStateMachine (const std::string &name)
 Stops the execution of a scripting::StateMachine and enters the Final_State. More...
 
bool resetStateMachine (const std::string &name)
 Resets the execution of a scripting::StateMachine and enters the Initial_State. More...
 
bool requestStateMachineState (const std::string &name, const std::string &state)
 Request a state change in a state machine. More...
 
Script State Machine OperationCallers
virtual bool hasStateMachine (const std::string &name) const
 Check if a state machine is loaded. More...
 
bool isStateMachineActive (const std::string &name) const
 Returns true if the state machine has been activated. More...
 
bool isStateMachineRunning (const std::string &name) const
 Returns true if the state machine was successfully started. More...
 
bool inStateMachineError (const std::string &name) const
 Returns true if the state machine is in error. More...
 
bool isStateMachinePaused (const std::string &name) const
 Returns true if the state machine is paused. More...
 
std::string getStateMachineState (const std::string &name) const
 Get the current state of a state machine. More...
 
bool inStateMachineState (const std::string &name, const std::string &state) const
 Check if a state machine is in a given state. More...
 

Static Public Member Functions

static shared_ptr Create (TaskContext *parent)
 Creates a ScriptingService object and registers the service to parent. More...
 
static Service::shared_ptr Create (const std::string &name, TaskContext *owner=0)
 Creates a Service with a name and an owner. More...
 

Protected Types

typedef std::map< std::string, StateMachinePtrStateMap
 
typedef StateMap::const_iterator StateMapIt
 
typedef std::map< std::string, ProgramInterfacePtrProgMap
 
typedef ProgMap::const_iterator ProgMapIt
 
typedef std::map< std::string, shared_ptrServices
 
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)
 
ServicecreatePortObject (const std::string &name)
 Create a Service through which one can access a Port. More...
 

Protected Attributes

StatementProcessorsproc
 
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. More...
 
Services services
 the services we implement. More...
 
SimpleOperations simpleoperations
 
OperationList ownedoperations
 
std::string mname
 
std::string mdescription
 
TaskContextmowner
 
shared_ptr parent
 
map_t data
 
map_t values
 
PropertyBag bag
 
Ports mports
 All our ports. More...
 
Servicemservice
 The parent Service. More...
 

Detailed Description

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.

Member Typedef Documentation

The arguments for an operation.

Definition at line 71 of file OperationInterface.hpp.

typedef std::vector<std::string> RTT::ConfigurationInterface::AttributeNames
inherited

A vector containing the names of all attribute objects in this repository.

Definition at line 74 of file ConfigurationInterface.hpp.

A vector containing pointers to all attribute objects stored in this repository.

Definition at line 80 of file ConfigurationInterface.hpp.

The descriptions of an argumentlist.

Definition at line 204 of file OperationInterface.hpp.

Definition at line 100 of file Service.hpp.

List of executed functions.

Definition at line 224 of file ScriptingService.hpp.

typedef std::map<std::string, OperationInterfacePart*> RTT::OperationInterface::map_t
protectedinherited

Definition at line 65 of file OperationInterface.hpp.

typedef std::vector<base::AttributeBase*> RTT::ConfigurationInterface::map_t
protectedinherited

Definition at line 336 of file ConfigurationInterface.hpp.

typedef std::vector<base::OperationBase*> RTT::Service::OperationList
protectedinherited

Definition at line 567 of file Service.hpp.

typedef std::vector<std::string> RTT::DataFlowInterface::PortNames
inherited

A sequence of names of ports.

Definition at line 70 of file DataFlowInterface.hpp.

typedef std::vector<base::PortInterface*> RTT::DataFlowInterface::Ports
inherited

A sequence of pointers to ports.

Definition at line 65 of file DataFlowInterface.hpp.

typedef std::map<std::string,ProgramInterfacePtr> RTT::scripting::ScriptingService::ProgMap
protected

Definition at line 571 of file ScriptingService.hpp.

typedef ProgMap::const_iterator RTT::scripting::ScriptingService::ProgMapIt
protected

Definition at line 573 of file ScriptingService.hpp.

Definition at line 80 of file ScriptingService.hpp.

typedef std::vector<std::string> RTT::Service::ProviderNames
inherited

Definition at line 103 of file Service.hpp.

typedef std::map< std::string, shared_ptr > RTT::Service::Services
protectedinherited

Definition at line 561 of file Service.hpp.

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

Definition at line 102 of file Service.hpp.

Definition at line 64 of file ScriptingService.hpp.

typedef std::map<std::string,base::OperationBase* > RTT::Service::SimpleOperations
protectedinherited

Definition at line 566 of file Service.hpp.

typedef boost::function<void(base::PortInterface*)> RTT::DataFlowInterface::SlotFunction
inherited

Definition at line 72 of file DataFlowInterface.hpp.

Definition at line 81 of file ScriptingService.hpp.

typedef std::map<std::string,StateMachinePtr> RTT::scripting::ScriptingService::StateMap
protected

Definition at line 567 of file ScriptingService.hpp.

typedef StateMap::const_iterator RTT::scripting::ScriptingService::StateMapIt
protected

Definition at line 569 of file ScriptingService.hpp.

Constructor & Destructor Documentation

RTT::ScriptingService::ScriptingService ( TaskContext parent)

Creates a ScriptingService object.

You need to add the service to parent yourself, or use Create().

Definition at line 71 of file ScriptingService.cpp.

References RTT::ConfigurationInterface::addProperty(), createInterface(), RTT::Service::doc(), and ZeroPeriodWarning.

RTT::ScriptingService::~ScriptingService ( )
virtual

Definition at line 84 of file ScriptingService.cpp.

References clear(), and sproc.

Member Function Documentation

bool RTT::ScriptingService::activateStateMachine ( const std::string &  name)

Activate a previously loaded StateMachine.

Parameters
nameThe name of the StateMachine.

Definition at line 869 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

void OperationInterface::add ( const std::string &  name,
OperationInterfacePart part 
)
inherited

Add a new operation to the interface or replace an existing one.

Parameters
nameThe name of the operation
partA part which creates the operation.

Definition at line 170 of file OperationInterface.cpp.

template<class T >
bool RTT::ConfigurationInterface::addAttribute ( const std::string &  name,
T &  attr 
)
inlineinherited

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.

Parameters
nameThe name of this attribute
attrThe variable that will be aliased.

Definition at line 101 of file ConfigurationInterface.hpp.

template<class T >
Attribute<T>& RTT::ConfigurationInterface::addAttribute ( const std::string &  name,
Attribute< T > &  attr 
)
inlineinherited

Adds an existing attribute object to the configuration interface.

Parameters
nameThe name of this attribute. attr will be initialized with this name.
attrThe attribute to add
Returns
the Attribute object by reference, which you can further query or use.
Postcondition
attr.ready() == true

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)
inlineinherited

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.

Parameters
aremains 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().

template<class T >
bool RTT::ConfigurationInterface::addConstant ( const std::string &  name,
const T &  cnst 
)
inlineinherited

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.

Parameters
nameThe name of this attribute
cnstThe variable that will be aliased.

Definition at line 135 of file ConfigurationInterface.hpp.

template<class T >
Constant<T>& RTT::ConfigurationInterface::addConstant ( const std::string &  name,
Constant< T > &  cnst 
)
inlineinherited

Adds an existing constant object to the configuration interface.

Parameters
nameThe name of this constant. cnst will be initialized with this name.
cnstThe 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.
Returns
the Constant object by reference, which you can further query or use.
Postcondition
cnst.ready() == true

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)
inlineinherited

Add a Constant with a given value.

See also
getConstant

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() 
)
inlineinherited

Name and add an Event triggering Port to the interface of this task and add a Service with the same name of the port.

Parameters
nameThe name to give to the port.
portThe 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 instead of updateHook(). Use this->trigger() in your callback function in order to schedule an updateHook() nevertheless in the same cycle. If callback is not provided, updateHook() will be executed by default.

Definition at line 117 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 by default.

Parameters
portThe 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 instead of updateHook(). Use this->trigger() in your callback function in order to schedule an updateHook() nevertheless in the same cycle. If callback is not provided, updateHook() will be executed by default.
Returns
port

Definition at line 97 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::addLocalEventPort(), RTT::Service::addService(), RTT::DataFlowInterface::chkPtr(), RTT::Handle::connect(), RTT::DataFlowInterface::createPortObject(), RTT::Handle::disconnect(), RTT::base::PortInterface::getName(), RTT::Service::hasService(), RTT::DataFlowInterface::mservice, RTT::Service::provides(), RTT::Service::removeService(), and RTT::Warning.

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.

Parameters
portThe 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.
Returns
port

Definition at line 135 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::addLocalPort(), RTT::Error, RTT::base::PortInterface::getName(), RTT::Service::getName(), RTT::Service::getOwner(), RTT::Info, RTT::DataFlowInterface::mservice, RTT::base::InputPortInterface::signalInterface(), and RTT::base::TaskCore::trigger().

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.

Note
Do not use this function unless you know what you're doing.
See also
addOperation() for adding normal, remotely available operations.
Parameters
opThe Operation object to add
Returns
true if it could be added, false otherwise.

Definition at line 178 of file Service.cpp.

References RTT::base::TaskCore::engine(), RTT::Error, RTT::base::OperationBase::getImplementation(), RTT::base::OperationBase::getName(), RTT::Service::mowner, RTT::Service::removeOperation(), RTT::base::OperationBase::setOwner(), RTT::Service::simpleoperations, and RTT::Warning.

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.

Returns
port

Definition at line 82 of file DataFlowInterface.cpp.

References RTT::base::PortInterface::getName(), RTT::DataFlowInterface::mports, RTT::DataFlowInterface::removeLocalPort(), RTT::base::PortInterface::setInterface(), and RTT::Warning.

Referenced by RTT::DataFlowInterface::addLocalEventPort(), and RTT::DataFlowInterface::addPort().

template<class Signature >
Operation<Signature>& RTT::Service::addOperation ( Operation< Signature > &  op)
inlineinherited

Add an operation object to the interface.

This version of addOperation exports an existing Operation object to the public interface of this component.

Parameters
opThe operation object to add.
Returns
The given parameter op

Definition at line 341 of file Service.hpp.

References RTT::base::OperationBase::getName().

Referenced by createInterface(), and RTT::marsh::MarshallingService::MarshallingService().

template<class Func , class Class >
Operation< typename internal::GetSignature<Func>::Signature >& RTT::Service::addOperation ( const std::string  name,
Func  func,
Class *  obj,
ExecutionThread  et = ClientThread 
)
inlineinherited

Add an operation to the interface by means of a C++ Class member function.

The function func must be a C++ member function and obj is the object having that function.

Parameters
nameThe name of the new operation
funcA pointer to a function, for example, &Bar::foo (C++ class function).
objA pointer to the object that will execute the function.
etThe 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 ?
Returns
A newly created operation object, which you may further document or query.

Definition at line 402 of file Service.hpp.

template<class Func >
Operation< Func >& RTT::Service::addOperation ( const std::string  name,
Func *  func,
ExecutionThread  et = ClientThread 
)
inlineinherited

Add an operation to the interface by means of a free C/C++ function.

The function func must be a free C/C++ function.

Parameters
nameThe name of the new operation
funcA pointer to a C function, for example, &foo (or a static C++ class function).
etThe 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 ?
Returns
A newly created operation object, which you may further document or query.

Definition at line 423 of file Service.hpp.

References RTT::ClientThread.

template<class Func , class ObjT >
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 
)
inlineinherited

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 506 of file Service.hpp.

Referenced by RTT::scripting::ProgramService::ProgramService().

template<class Signature , class ObjT >
Operation<Signature>& RTT::Service::addOperationDS ( internal::DataSource< boost::shared_ptr< ObjT > > *  sp,
Operation< Signature > &  op 
)
inlineinherited

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 521 of file Service.hpp.

References RTT::base::OperationBase::getName().

base::PortInterface& RTT::DataFlowInterface::addPort ( const std::string &  name,
base::PortInterface port 
)
inlineinherited

Name and add a Port to the interface of this task and add a Service with the same name of the port.

Parameters
nameThe name to give to the port.
portThe 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.

Parameters
portThe port to add.
Returns
port

Definition at line 59 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::addLocalPort(), RTT::Service::addService(), RTT::DataFlowInterface::chkPtr(), RTT::DataFlowInterface::createPortObject(), RTT::base::PortInterface::getName(), RTT::Service::hasService(), RTT::DataFlowInterface::mservice, RTT::Service::provides(), RTT::Service::removeService(), and RTT::Warning.

template<class T >
Property<T>& RTT::ConfigurationInterface::addProperty ( const std::string &  name,
T &  prop 
)
inlineinherited

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.

Parameters
nameThe name of this property
propThe variable that will be aliased.
Returns
the Property object by reference, which you can further query or document.

Definition at line 171 of file ConfigurationInterface.hpp.

Referenced by ScriptingService().

template<class T >
Property<T>& RTT::ConfigurationInterface::addProperty ( const std::string &  name,
Property< T > &  prop 
)
inlineinherited

Adds an existing property object to the configuration interface.

Parameters
nameThe name of this property. prop will be initialized with this name.
propThe property to add
Returns
the Property object by reference, which you can further query or document.
Postcondition
prop.ready() == true

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.

Returns
false if a property with the same name already exists.
See also
removeProperty

Definition at line 90 of file ConfigurationInterface.cpp.

References RTT::base::PropertyBase::getName().

bool RTT::Service::addService ( Service::shared_ptr  obj)
virtualinherited

Add a new sub-service to this Service.

Parameters
objThis object becomes owned by this Service.
Note
obj will take a Service::shared_ptr to this and vice versa. In case this Service is not yet reference counted, obj will hold the only reference count to this.
Returns
true if it could be added, false if such service already exists.

Definition at line 81 of file Service.cpp.

References RTT::Error, RTT::Service::mowner, and RTT::Service::services.

Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), and RTT::Service::provides().

template<class Signature >
Operation<Signature>& RTT::Service::addSynchronousOperation ( Operation< Signature > &  op)
inlineinherited

Add an operation object to the interface.

This version exports an existing Operation object to the synchronous interface of the component

Parameters
opThe operation object to add.
Returns
The given parameter op

Definition at line 379 of file Service.hpp.

References RTT::base::OperationBase::getName().

Referenced by RTT::base::PortInterface::createPortObject().

template<class Func , class Class >
Operation< typename internal::GetSignature<Func>::Signature >& RTT::Service::addSynchronousOperation ( const std::string  name,
Func  func,
Class *  obj,
ExecutionThread  et = ClientThread 
)
inlineinherited

Add an operation to the synchronous interface by means of a function.

The function func must be a C++ Class member function.

Parameters
nameThe name of the new operation
funcA pointer to a function, for example &Bar::foo (C++ class function).
objA pointer to the object that will execute the function in case of a C++ class function,
etThe 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 ?
Returns
A newly created operation object, which you may further document or query.

Definition at line 492 of file Service.hpp.

bool RTT::DataFlowInterface::chkPtr ( const std::string &  where,
const std::string &  name,
const void *  ptr 
)
protectedinherited
bool RTT::ConfigurationInterface::chkPtr ( const std::string &  where,
const std::string &  name,
const void *  ptr 
)
protectedinherited

Definition at line 156 of file ConfigurationInterface.cpp.

References RTT::Error.

void RTT::ScriptingService::clear ( )
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.

Parameters
instantiateset to true if you want a copy which will upon any future copy return the same DataSources, thus 'fixating' or 'instantiating' the DataSources.
See also
base::ActionInterface
Note
this does not copy the properties() within this repository.

Definition at line 60 of file ConfigurationInterface.cpp.

References RTT::ConfigurationInterface::setValue(), and RTT::internal::values().

Referenced by RTT::scripting::StateMachineService::copy().

ScriptingService::shared_ptr RTT::ScriptingService::Create ( TaskContext parent)
static

Creates a ScriptingService object and registers the service to parent.

Definition at line 65 of file ScriptingService.cpp.

References RTT::TaskContext::provides().

Service::shared_ptr RTT::Service::Create ( const std::string &  name,
TaskContext owner = 0 
)
staticinherited

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.

Parameters
nameThe name of this service.
ownerThe TaskContext that will execute the operations of this service.
Warning
When using boost < 1.40, the owner is not stored in the Service, until the Service object is effectively added to the TaskContext.
See also
getOwner()

Definition at line 50 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).

Parameters
nameThe name of the operation
Returns
An object which can invoke a operation.

Definition at line 268 of file Service.cpp.

References RTT::OperationInterface::getPart().

void RTT::ScriptingService::createInterface ( void  )
protected
Service * RTT::DataFlowInterface::createPortObject ( const std::string &  name)
protectedinherited
void RTT::DataFlowInterface::dataOnPort ( base::PortInterface port)
inherited

Used by the input ports to notify this class of new data.

Definition at line 128 of file DataFlowInterface.cpp.

References RTT::Service::getOwner(), and RTT::DataFlowInterface::mservice.

bool RTT::ScriptingService::deactivateStateMachine ( const std::string &  name)

Deactivate a stopped StateMachine.

Parameters
nameThe name of the StateMachine.

Definition at line 877 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::scripting::ScriptingService::deleteProgram ( const std::string &  name)

Completely discard a loaded Program.

Exceptions
program_unload_exceptionif the program is not stopped or does not exist.
Deprecated:
by unloadProgram
bool RTT::ScriptingService::deleteStateMachine ( const std::string &  name)

Delete a deactivated State Machine and all its children.

Exceptions
program_unload_exceptionif the state machine or one of its children is still active.
Deprecated:
by unloadStateMachine

Definition at line 306 of file ScriptingService.cpp.

References unloadStateMachine().

const std::string& RTT::Service::doc ( ) const
inlineinherited
void RTT::Service::doc ( const std::string &  description)
inlineinherited

Sets the descriptive text for this service.

Definition at line 149 of file Service.hpp.

bool RTT::ScriptingService::doExecute ( const std::string &  code)
protected

Definition at line 416 of file ScriptingService.cpp.

References execute().

bool RTT::ScriptingService::doLoadPrograms ( const std::string &  filename)
protected

Definition at line 421 of file ScriptingService.cpp.

References loadPrograms().

Referenced by createInterface().

bool RTT::ScriptingService::doLoadProgramText ( const std::string &  code)
protected

Definition at line 426 of file ScriptingService.cpp.

References loadPrograms().

Referenced by createInterface().

bool RTT::ScriptingService::doLoadStateMachines ( const std::string &  filename)
protected

Definition at line 435 of file ScriptingService.cpp.

References loadStateMachines().

Referenced by createInterface().

bool RTT::ScriptingService::doLoadStateMachineText ( const std::string &  code)
protected

Definition at line 439 of file ScriptingService.cpp.

References loadStateMachines().

Referenced by createInterface().

bool RTT::ScriptingService::doUnloadProgram ( const std::string &  name)
protected

Definition at line 430 of file ScriptingService.cpp.

References unloadProgram().

Referenced by createInterface().

bool RTT::ScriptingService::doUnloadStateMachine ( const std::string &  name)
protected

Definition at line 443 of file ScriptingService.cpp.

References unloadStateMachine().

Referenced by createInterface().

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.

Parameters
codeA list of statements, program/function definitions etc. which get evaluated in the context of this component
Returns
true if the parsing and execution succeeded (= no syntax errors and no exceptions thrown when executing code ), false otherwise.
Exceptions
parse_exceptionand its derivatives for parse errors in code.

Definition at line 596 of file ScriptingService.cpp.

References evalInternal().

Referenced by createInterface().

bool RTT::ScriptingService::evalInternal ( const std::string &  filename,
const std::string &  code 
)
protected
int RTT::ScriptingService::execute ( const std::string &  code)

Parse and execute a statement.

Parameters
codeA single statement to execute.
Returns
A ticket number.
Return values
-1if the code could not be parsed.
0if the code was an expression and could be executed.
>0if the code was a command and is being executed.
See also
getCommand
Deprecated:
by eval()

Definition at line 516 of file ScriptingService.cpp.

References RTT::scripting::StatementProcessor::execute(), RTT::Service::mowner, and sproc.

Referenced by createInterface(), and doExecute().

OperationInterface::Descriptions OperationInterface::getArgumentList ( const std::string &  name) const
inherited

Get the names and descriptions of all arguments of an operation.

Parameters
nameThe name of the operation
Returns
A list of descriptions.
Exceptions
name_not_found_exception

Definition at line 146 of file OperationInterface.cpp.

References ORO_THROW_OR_RETURN.

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.

Parameters
nameThe name of the operation
Returns
The arity, or -1 if name is not found.

Definition at line 77 of file OperationInterface.cpp.

base::AttributeBase* RTT::ConfigurationInterface::getAttribute ( const std::string &  name) const
inlineinherited
std::vector< std::string > RTT::ConfigurationInterface::getAttributeNames ( ) const
inherited

Return the names of all attributes in this repository.

Definition at line 138 of file ConfigurationInterface.cpp.

References RTT::base::AttributeBase::getName(), and RTT::internal::values().

Referenced by RTT_corba_CConfigurationInterface_i::getAttributeList().

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.

Parameters
nameThe name of the operation
Returns
The arity, or -1 if name is not found.

Definition at line 85 of file OperationInterface.cpp.

base::AttributeBase* RTT::ConfigurationInterface::getConstant ( const std::string &  name) const
inlineinherited

Definition at line 245 of file ConfigurationInterface.hpp.

References RTT::removeProperty().

std::string OperationInterface::getDescription ( const std::string &  name) const
inherited

Get the description of an operation.

Parameters
nameThe name of the operation
Returns
A user readable description.
Exceptions
name_not_found_exception

Definition at line 162 of file OperationInterface.cpp.

References ORO_THROW_OR_RETURN.

boost::shared_ptr< base::DisposableInterface > RTT::Service::getLocalOperation ( std::string  name)
inherited

Get a locally added operation from this interface.

Note
Do not use this function unless you know what you're doing.
See also
getOperation() for getting normal, remotely available operations.

Definition at line 203 of file Service.cpp.

References RTT::Service::hasOperation(), and RTT::Service::simpleoperations.

const std::string& RTT::Service::getName ( ) const
inlineinherited
std::vector< std::string > OperationInterface::getNames ( ) const
inherited

Get a list of all the names of the added operations.

Definition at line 65 of file OperationInterface.cpp.

Referenced by RTT_corba_COperationInterface_i::getOperations().

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.

Parameters
nameThe name of the operation to retrieve.
Returns
A pointer to an operation interface part or a null pointer if name was not found.

Definition at line 142 of file Service.cpp.

References RTT::Service::getName(), RTT::OperationInterface::getPart(), RTT::OperationInterface::hasMember(), and RTT::Warning.

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
inlineinherited

For internal use only.

Get a previously added operation as a DataSource. This function is inferior to getOperation(std::string name)

Parameters
nameThe name of the operation
argsThe arguments of the operation as Data Sources.
Returns
A internal::DataSource which, when evaluated, invokes the operation.

Definition at line 540 of file Service.hpp.

std::vector< std::string > RTT::Service::getOperationNames ( ) const
inherited

Returns the names of all operations added to this interface.

See also
getNames() to get a list of all operations available to scripting.

Definition at line 230 of file Service.cpp.

References RTT::internal::keys(), and RTT::Service::simpleoperations.

TaskContext* RTT::Service::getOwner ( ) const
inlineinherited

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

A Service can only belong to one TaskContext.

Note
This function will only return the owner after the Service has been added to the TaskContext.

Definition at line 185 of file Service.hpp.

Referenced by RTT::DataFlowInterface::addLocalEventPort(), RTT::DataFlowInterface::dataOnPort(), RTT::DataFlowInterface::getOwner(), RTT::Service::getOwnerExecutionEngine(), loadProgram(), loadStateMachine(), RTT::DataFlowInterface::removePort(), and RTT::Service::setOperationThread().

ExecutionEngine * RTT::Service::getOwnerExecutionEngine ( ) const
inherited

Return the execution engine of this service owner.

See also
getOwner

Definition at line 75 of file Service.cpp.

References RTT::base::TaskCore::engine(), and RTT::Service::getOwner().

shared_ptr RTT::Service::getParent ( ) const
inlineinherited
OperationInterfacePart * OperationInterface::getPart ( const std::string &  name)
inherited

Get a previously added part of this factory.

Parameters
name
Returns

Definition at line 188 of file OperationInterface.cpp.

Referenced by RTT::Service::create(), RTT::Service::getOperation(), and RTT_corba_COperationInterface_i::sendOperationOneway().

PortInterface * RTT::DataFlowInterface::getPort ( const std::string &  name) const
inherited

Get an added port.

Parameters
nameThe port name
Returns
a pointer to a port or null if it does not exist.

Definition at line 211 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::mports.

Referenced by RTT::corba::CDataFlowInterface_i::_default_POA(), RTT::TaskContext::connectPorts(), RTT::DataFlowInterface::createPortObject(), and RTT::corba::CDataFlowInterface_i::deregisterChannel().

std::string RTT::DataFlowInterface::getPortDescription ( const std::string &  name) const
inherited

Get the description of an added Port.

Parameters
nameThe port name
Returns
The description or "" if it does not exist.

Definition at line 220 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.

Returns
A sequence of strings containing the port names.
Deprecated:
by getNames()

Definition at line 202 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::mports.

Referenced by RTT::corba::CDataFlowInterface_i::_default_POA().

DataFlowInterface::Ports RTT::DataFlowInterface::getPorts ( ) const
inherited

Get all ports of this interface.

Returns
A sequence of pointers to ports.

Definition at line 198 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::mports.

Referenced by RTT::TaskContext::connectPorts(), and RTT::TaskContext::disconnect().

template<class Type >
Type* RTT::DataFlowInterface::getPortType ( const std::string &  name)
inlineinherited

Get a port of a specific type.

Definition at line 244 of file DataFlowInterface.hpp.

const ProgramInterfacePtr RTT::ScriptingService::getProgram ( const std::string &  name) const

Get a pointer to a loaded Program.

Definition at line 403 of file ScriptingService.cpp.

References programs.

Referenced by getProgramLine(), getProgramText(), inProgramError(), isProgramPaused(), isProgramRunning(), pauseProgram(), startProgram(), stepProgram(), and stopProgram().

ProgramInterfacePtr RTT::ScriptingService::getProgram ( const std::string &  name)

Definition at line 409 of file ScriptingService.cpp.

References programs.

int RTT::ScriptingService::getProgramLine ( const std::string &  name) const
virtual

Get the current line of execution of a loaded program script.

Parameters
nameThe name of the program.
Returns
The line number.
Return values
-1if the program does not exist.
0if the program is not running.
nthe line number if the program is executing.

Definition at line 789 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

vector< string > RTT::ScriptingService::getProgramList ( ) const

Get a list of all loaded Programs.

Definition at line 398 of file ScriptingService.cpp.

References RTT::internal::keys(), and programs.

Referenced by createInterface().

ProgramInterface::Status::ProgramStatus RTT::ScriptingService::getProgramStatus ( const std::string &  name) const

Return the status of a Program.

Definition at line 328 of file ScriptingService.cpp.

References programs, and RTT::scripting::ProgramInterface::Status::unknown.

Referenced by createInterface(), and getProgramStatusStr().

string RTT::ScriptingService::getProgramStatusStr ( const std::string &  name) const
string RTT::ScriptingService::getProgramText ( const std::string &  name) const
virtual

Get the original script description of a loaded program.

Parameters
nameThe name of the program.
Returns
A string containing only that program.

Definition at line 794 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

base::PropertyBase* RTT::ConfigurationInterface::getProperty ( const std::string &  name) const
inlineinherited

Get a Property with name name.

Parameters
nameThe name of the property to search for.
Returns
The PropertyBase with this name, zero if it does not exist.

Definition at line 275 of file ConfigurationInterface.hpp.

vector< string > RTT::Service::getProviderNames ( ) const
virtualinherited

Return a standard container which contains all the sub-service names of this Service.

Definition at line 71 of file Service.cpp.

References RTT::internal::keys(), and RTT::Service::services.

std::string OperationInterface::getResultType ( const std::string &  name) const
inherited

Get the type name of the result type of an operation.

Parameters
nameThe name of the operation
Returns
A name of a data type.
Exceptions
name_not_found_exception

Definition at line 154 of file OperationInterface.cpp.

References ORO_THROW_OR_RETURN.

Service* RTT::DataFlowInterface::getService ( ) const
inlineinherited

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 203 of file DataFlowInterface.hpp.

Referenced by RTT::Service::provides().

Service::shared_ptr RTT::Service::getService ( const std::string &  service_name)
inherited

Returns a shared pointer to strictly a sub-service of a null pointer if !hasService(service_name).

This method will not return the this pointer when service_name equals "this" or create new service objects.

Parameters
service_nameThe name of the sub-service to be returned. or created, or the result of provides() in case of "this".

Definition at line 133 of file Service.cpp.

References RTT::Service::provides(), and RTT::Service::services.

Referenced by RTT::DataFlowInterface::setPortDescription().

const StateMachinePtr RTT::ScriptingService::getStateMachine ( const std::string &  name) const
StateMachinePtr RTT::ScriptingService::getStateMachine ( const std::string &  name)

Get a pointer to a loaded StateMachine.

Definition at line 317 of file ScriptingService.cpp.

References states.

int RTT::ScriptingService::getStateMachineLine ( const std::string &  name) const
virtual

Get the current line of execution of a loaded state machine script.

Parameters
nameThe name of the state machine.
Returns
The line number.
Return values
-1if the state machine does not exist.
0if the state machine is not running.
nthe line number if the state machine is executing.

Definition at line 808 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

vector< string > RTT::ScriptingService::getStateMachineList ( ) const

Get a list of all loaded StateMachines and their children.

Definition at line 323 of file ScriptingService.cpp.

References RTT::internal::keys(), and states.

Referenced by createInterface().

string RTT::ScriptingService::getStateMachineState ( const std::string &  name) const

Get the current state of a state machine.

Parameters
nameThe name of the StateMachine.

Definition at line 941 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

StateMachine::Status::StateMachineStatus RTT::ScriptingService::getStateMachineStatus ( const std::string &  name) const

Return the status of a StateMachine.

Definition at line 132 of file ScriptingService.cpp.

References states, and RTT::scripting::StateMachine::Status::unloaded.

Referenced by createInterface(), and getStateMachineStatusStr().

string RTT::ScriptingService::getStateMachineStatusStr ( const std::string &  name) const
string RTT::ScriptingService::getStateMachineText ( const std::string &  name) const
virtual

Get the original script description of a loaded state machine.

Parameters
nameThe name of the state machine.
Returns
A string containing only that state machine.

Definition at line 803 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

AttributeBase * RTT::ConfigurationInterface::getValue ( const std::string &  name) const
inherited
AttributeObjects const& RTT::ConfigurationInterface::getValues ( ) const
inlineinherited

Returns all attributes in this repository.

Definition at line 320 of file ConfigurationInterface.hpp.

References RTT::internal::values().

Referenced by RTT::scripting::StateMachineService::copy(), and RTT::scripting::ExpressionParser::getHandle().

bool RTT::ConfigurationInterface::hasAttribute ( const std::string &  name) const
inherited
bool OperationInterface::hasMember ( const std::string &  name) const
inherited

Query if an operation is present.

Definition at line 72 of file OperationInterface.cpp.

Referenced by RTT::Service::getOperation().

bool RTT::Service::hasOperation ( const std::string &  name) const
inherited

Query for the existence of a Operation in this interface.

See also
hasMember() to verify if a operation is available to scripting as well.

Definition at line 236 of file Service.cpp.

References RTT::Service::simpleoperations.

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.

Parameters
nameThe name of the program.
Returns
True if so.

Definition at line 785 of file ScriptingService.cpp.

References programs.

Referenced by createInterface().

bool RTT::ConfigurationInterface::hasProperty ( const std::string &  name) const
inherited

Check if a property is present.

Definition at line 124 of file ConfigurationInterface.cpp.

bool RTT::Service::hasService ( const std::string &  service_name)
inherited
bool RTT::ScriptingService::hasStateMachine ( const std::string &  name) const
virtual

Check if a state machine is loaded.

Parameters
nameThe name of the state machine.
Returns
True if so.

Definition at line 799 of file ScriptingService.cpp.

References states.

Referenced by createInterface().

bool RTT::ScriptingService::inProgramError ( const std::string &  name) const

Inspect if a loaded program is in the error state.

Parameters
nameThe name of the Program.
Returns
true if so.

Definition at line 837 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::inStateMachineError ( const std::string &  name) const

Returns true if the state machine is in error.

Parameters
nameThe name of the StateMachine.

Definition at line 933 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::inStateMachineState ( const std::string &  name,
const std::string &  state 
) const

Check if a state machine is in a given state.

Parameters
nameThe name of the StateMachine.
stateThe state to enter.
Returns
true if so.

Definition at line 957 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::isProgramPaused ( const std::string &  name) const

Inspect if a loaded program is in the paused state.

Parameters
nameThe name of the Program.
Returns
true if so.

Definition at line 829 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::isProgramRunning ( const std::string &  name) const

Inspect if a loaded program is in the running state.

Parameters
nameThe name of the Program.
Returns
true if so.

Definition at line 821 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::isStateMachineActive ( const std::string &  name) const

Returns true if the state machine has been activated.

Parameters
nameThe name of the StateMachine.

Definition at line 917 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::isStateMachinePaused ( const std::string &  name) const

Returns true if the state machine is paused.

Parameters
nameThe name of the StateMachine.

Definition at line 909 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::isStateMachineRunning ( const std::string &  name) const

Returns true if the state machine was successfully started.

Parameters
nameThe name of the StateMachine.

Definition at line 925 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool OperationInterface::isSynchronous ( const std::string &  name) const
inherited

Query if a given operation is limited to sychronous invocation (own component thread) only.

Returns
false if name not found or a normal operation, true if name exists but is synchronous.

Definition at line 93 of file OperationInterface.cpp.

Referenced by RTT_corba_COperationInterface_i::getOperations(), and RTT_corba_COperationInterface_i::sendOperationOneway().

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.

Parameters
filenameThe file to load
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
A list of functions loaded in the ProgramProcessor.
Deprecated:
by runScript

Definition at line 522 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, 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.

Parameters
codeA string containing the function definitions.
filenameThe file name to use in the error messages.
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
A list of functions loaded in the ProgramProcessor.
Deprecated:
by runScript

Definition at line 538 of file ScriptingService.cpp.

References RTT::Logger::Debug, RTT::Logger::endl(), RTT::base::TaskCore::engine(), RTT::Logger::Error, RTT::Logger::Info, RTT::Logger::log(), RTT::Service::mowner, RTT::Logger::nl(), RTT::ExecutionEngine::runFunction(), and RTT::file_parse_exception::what().

bool RTT::ScriptingService::loadProgram ( ProgramInterfacePtr  pi)

Load a new Program.

The Processor takes full ownership and will delete it upon destruction.

Exceptions
program_load_exceptionif a program with the same name already exists.

Definition at line 360 of file ScriptingService.cpp.

References RTT::base::TaskCore::engine(), RTT::Error, RTT::Service::getOwner(), RTT::Service::mowner, programs, RTT::ExecutionEngine::runFunction(), RTT::Warning, 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.

Parameters
filenameThe file to load
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
true if all state machines could be loaded in the ProgramProcessor.
Deprecated:
by runScript

Definition at line 615 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, and RTT::Logger::log().

Referenced by doLoadPrograms(), and doLoadProgramText().

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.

Parameters
codeA string containing the function definitions.
filenameThe file name to use in the error messages.
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
true if all state machines could be loaded in the ProgramProcessor.
Deprecated:
by runScript

Definition at line 631 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::base::TaskCore::engine(), RTT::Logger::Error, RTT::Logger::Info, loadProgram(), RTT::Logger::log(), RTT::Service::mowner, RTT::Logger::nl(), RTT::scripting::program_load_exception::what(), and RTT::file_parse_exception::what().

bool RTT::ScriptingService::loadStateMachine ( StateMachinePtr  sc)

Load a new State Machine and all its children.

Exceptions
program_load_exceptionif a state machine with the same name already exists.

Definition at line 185 of file ScriptingService.cpp.

References RTT::Service::getOwner(), ORO_THROW_OR_RETURN, recursiveCheckLoadStateMachine(), recursiveLoadStateMachine(), RTT::Warning, 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.

Parameters
filenameThe file to load
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
true if all state machines could be loaded in the StateMachineProcessor.
Deprecated:
by runScript

Definition at line 700 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, and RTT::Logger::log().

Referenced by doLoadStateMachines(), and doLoadStateMachineText().

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.

Parameters
codeA string containing the function definitions.
filenameThe file name to use in the error messages.
do_throwSet to yes to cause the parse errors to be thrown instead of being printed to the Logger interface.
Returns
true if all state machines could be loaded in the StateMachineProcessor.
Deprecated:
by runScript

Definition at line 716 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::base::TaskCore::engine(), RTT::Logger::Error, RTT::Logger::Info, loadStateMachine(), RTT::Logger::log(), RTT::Service::mowner, RTT::Logger::nl(), RTT::scripting::program_load_exception::what(), and RTT::file_parse_exception::what().

void RTT::ConfigurationInterface::loadValues ( AttributeObjects const &  new_values)
inherited

Adds these attributes to this repository.

Definition at line 145 of file ConfigurationInterface.cpp.

References RTT::internal::values().

bool RTT::ScriptingService::pauseProgram ( const std::string &  name)

Pauses the execution of a running program.

Parameters
nameThe name of the Program.

Definition at line 853 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::pauseStateMachine ( const std::string &  name)

Pause a previously activated StateMachine.

Parameters
nameThe name of the StateMachine.

Definition at line 893 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

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().

Parameters
nameThe name of the operation
argsThe arguments filled in as data sources.
Returns
a new object
Exceptions
wrong_number_of_args_exception
wrong_types_of_args_exception
name_not_found_exception

Definition at line 105 of file OperationInterface.cpp.

References ORO_THROW_OR_RETURN.

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.

Parameters
nameThe name of the operation
argsThe arguments filled in as data sources.
blockingSet to true to block on the result.
Returns
a new object
Exceptions
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.

References ORO_THROW_OR_RETURN.

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.

Parameters
nameThe name of the operation
argsThe arguments filled in as data sources.
Returns
a new object
Exceptions
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.

References ORO_THROW_OR_RETURN.

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.

Parameters
nameThe name of the operation
argsThe arguments filled in as data sources.
Returns
a new object
Exceptions
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.

References ORO_THROW_OR_RETURN.

PropertyBag * RTT::ConfigurationInterface::properties ( )
inherited
Service::shared_ptr RTT::Service::provides ( )
inherited
Service::shared_ptr RTT::Service::provides ( const std::string &  service_name)
inherited

Returns a sub-Service which resorts under this Service, creating a new one if it does not yet exists.

Use getService() if no Service object creation should be done.

Parameters
service_nameThe name of the sub-service to be returned or created, or the result of provides() in case of "this".
See also
provides() for querying for "this".

Definition at line 123 of file Service.cpp.

References RTT::Service::addService(), RTT::DataFlowInterface::getService(), and RTT::Service::mowner.

bool RTT::ScriptingService::recursiveCheckLoadStateMachine ( StateMachinePtr  sc)
protected

Definition at line 210 of file ScriptingService.cpp.

References ORO_THROW_OR_RETURN, and states.

Referenced by loadStateMachine().

bool RTT::ScriptingService::recursiveCheckUnloadStateMachine ( StateMachinePtr  si)
protected

Definition at line 266 of file ScriptingService.cpp.

References ORO_THROW_OR_RETURN, and states.

Referenced by unloadStateMachine().

void RTT::ScriptingService::recursiveLoadStateMachine ( StateMachinePtr  sc)
protected
void RTT::ScriptingService::recursiveUnloadStateMachine ( StateMachinePtr  sc)
protected
void OperationInterface::remove ( const std::string &  name)
inherited

Remove an added operation from the interface.

Parameters
nameThe name of the operation

Definition at line 178 of file OperationInterface.cpp.

Referenced by RTT::Service::removeOperation().

void RTT::ConfigurationInterface::removeAttribute ( const std::string &  name)
inherited

Remove an attribute from the repository.

Definition at line 96 of file ConfigurationInterface.cpp.

Referenced by RTT::scripting::ExpressionParser::getHandle().

void RTT::DataFlowInterface::removeLocalPort ( const std::string &  name)
inherited

Remove a locally added Port from this interface.

This will remove all connections and callbacks assosiated with this port.

Parameters
portThe port to remove.
Note
this function will not check if a service with the same name as name exists, and will not remove it. So use removePort() in case you want to get rid of the service as well.

Definition at line 186 of file DataFlowInterface.cpp.

References RTT::DataFlowInterface::mports.

Referenced by RTT::DataFlowInterface::addLocalPort().

void RTT::Service::removeOperation ( const std::string &  name)
inherited
void RTT::DataFlowInterface::removePort ( const std::string &  name)
inherited

Remove a Port from this interface.

This will remove all services, connections and callbacks assosiated with this port.

Parameters
portThe port to remove.
Note
Since services are refcounted, removePort may effectively delete the this object in case no Service::shared_ptr exists to this DataFlowInterface. In order to prevent such cleanup, create a Service::shared_ptr to this object before calling removePort().

Definition at line 165 of file DataFlowInterface.cpp.

References RTT::Service::getOwner(), RTT::Service::hasService(), RTT::DataFlowInterface::mports, RTT::DataFlowInterface::mservice, RTT::Service::provides(), and RTT::Service::removeService().

bool RTT::ConfigurationInterface::removeProperty ( base::PropertyBase p)
inherited

Remove a previously added Property and associated attribute.

Returns
false if no such property exists.

Definition at line 129 of file ConfigurationInterface.cpp.

References RTT::base::PropertyBase::getName().

void RTT::Service::removeService ( std::string const &  service_name)
virtualinherited

Remove a previously added sub-service, potentially freeing it (and this) from memory.

Parameters
service_namethe name of the service to remove.
Note
Since service_name holds a reference to this Service, removeService may also delete this Service. In order to protect against such deletion, take a Service::shared_ptr to this before calling removeService.

Definition at line 103 of file Service.cpp.

References RTT::Service::services.

Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), RTT::DataFlowInterface::clear(), RTT::Service::clear(), and RTT::DataFlowInterface::removePort().

bool RTT::ConfigurationInterface::removeValue ( const std::string &  name)
inherited

Delete a value added with setValue from the repository.

Definition at line 100 of file ConfigurationInterface.cpp.

References RTT::base::AttributeBase::getName(), and RTT::internal::values().

bool RTT::ScriptingService::requestStateMachineState ( const std::string &  name,
const std::string &  state 
)

Request a state change in a state machine.

Parameters
nameThe name of the StateMachine.
stateThe state to enter.
Returns
true if the state change request was accepted.

Definition at line 949 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::Service::resetOperation ( std::string  name,
base::OperationBase impl 
)
inherited

Reset the implementation of a operation.

Definition at line 152 of file Service.cpp.

References RTT::Service::hasOperation(), and RTT::Service::simpleoperations.

bool RTT::ScriptingService::resetStateMachine ( const std::string &  name)

Resets the execution of a scripting::StateMachine and enters the Initial_State.

Parameters
nameThe name of the StateMachine.

Definition at line 965 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::runScript ( const std::string &  filename)

Run a script which is stored in a file.

Parameters
filenameThe local file to load and execute
Returns
true if the parsing and execution succeeded (= no syntax errors and no exceptions thrown when executing code ), false otherwise.
Exceptions
parse_exceptionand its derivatives for parse errors in code.

Definition at line 578 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, evalInternal(), RTT::Info, and RTT::Logger::log().

Referenced by createInterface().

void RTT::Service::setName ( const std::string &  name)
inlineinherited

Changes the name of this service.

Definition at line 154 of file Service.hpp.

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.

Parameters
nameThe name of the operation to modify. For example, "start".
etThe ExecutionThread type in which the function of the operation will be executed, being OwnThread or ClientThread.
Returns
true if name was a local, present operation, false otherwise.

Definition at line 160 of file Service.cpp.

References RTT::OperationInterfacePart::getLocalOperation(), RTT::Service::getOperation(), RTT::Service::getOwner(), RTT::Service::hasOperation(), and RTT::base::OperationCallerInterface::setThread().

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

Sets the owning TaskContext that will execute the operations in this service.

Definition at line 254 of file Service.cpp.

References RTT::base::TaskCore::engine(), RTT::Service::mowner, RTT::Service::services, and RTT::Service::simpleoperations.

Referenced by RTT::scripting::StateMachineService::StateMachineService().

void RTT::Service::setParent ( Service::shared_ptr  p)
inherited

Sets the parent service in case this service is a sub-service.

Definition at line 264 of file Service.cpp.

References RTT::Service::parent.

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.

Parameters
nameThe port name
descriptionThe new description for this port's service
Returns
true if the port was found and the description was set, false otherwise.

Definition at line 229 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.

Parameters
abThe attribute which becomes owned by this repository.
Returns
false if an Attribute with the same name already present.

Definition at line 78 of file ConfigurationInterface.cpp.

References RTT::base::AttributeBase::getDataSource(), RTT::base::AttributeBase::getName(), and RTT::internal::values().

Referenced by RTT::ConfigurationInterface::copy(), and RTT::scripting::ExpressionParser::getHandle().

bool RTT::ScriptingService::startProgram ( const std::string &  name)

Start a Program.

Parameters
nameThe name of the Program.

Definition at line 813 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::startStateMachine ( const std::string &  name)

Start a previously activated StateMachine.

Parameters
nameThe name of the StateMachine.

Definition at line 885 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::ScriptingService::stepProgram ( const std::string &  name)

Steps a single instruction of a paused program.

Parameters
nameThe name of the Program.

Definition at line 861 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::stopProgram ( const std::string &  name)

Stops the execution of a program.

Parameters
nameThe name of the Program.

Definition at line 845 of file ScriptingService.cpp.

References getProgram().

Referenced by createInterface().

bool RTT::ScriptingService::stopStateMachine ( const std::string &  name)

Stops the execution of a scripting::StateMachine and enters the Final_State.

Parameters
nameThe name of the StateMachine.

Definition at line 901 of file ScriptingService.cpp.

References getStateMachine().

Referenced by createInterface().

bool RTT::Service::testOperation ( base::OperationBase op)
protectedinherited
bool RTT::ScriptingService::unloadProgram ( const std::string &  name)

Unload a program from this processor.

Exceptions
program_unload_exceptionif the program is not stopped or does not exist.

Definition at line 383 of file ScriptingService.cpp.

References RTT::base::TaskCore::engine(), RTT::Service::mowner, ORO_THROW_OR_RETURN, programs, and RTT::ExecutionEngine::removeFunction().

Referenced by clear(), doUnloadProgram(), and unloadProgram().

bool RTT::ScriptingService::unloadProgram ( const std::string &  name,
bool  do_throw 
)
virtual

Unload a program from the Program Processor.

Parameters
nameThe name of the loaded program.
do_throwSet to yes to cause the unloading errors to be thrown instead of being printed to the Logger interface.
Returns
true if it could be unloaded

Definition at line 681 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, RTT::Logger::Info, RTT::Logger::log(), RTT::Logger::nl(), unloadProgram(), and RTT::scripting::program_unload_exception::what().

bool RTT::ScriptingService::unloadStateMachine ( const std::string &  name)

Unload a deactivated State Machine and all its children.

Exceptions
program_unload_exceptionif the state machine or one of its children is still active.

Definition at line 246 of file ScriptingService.cpp.

References ORO_THROW_OR_RETURN, recursiveCheckUnloadStateMachine(), recursiveUnloadStateMachine(), and states.

Referenced by clear(), deleteStateMachine(), doUnloadStateMachine(), and unloadStateMachine().

bool RTT::ScriptingService::unloadStateMachine ( const std::string &  name,
bool  do_throw 
)
virtual

Unload a state machine from the StateMachineProcessor.

Parameters
nameThe name of the loaded program.
do_throwSet to yes to cause the unloading errors to be thrown instead of being printed to the Logger interface.
Returns
true if it could be unloaded

Definition at line 767 of file ScriptingService.cpp.

References RTT::Logger::endl(), RTT::Logger::Error, RTT::Logger::Info, RTT::Logger::log(), RTT::Logger::nl(), unloadStateMachine(), and RTT::scripting::program_unload_exception::what().

Member Data Documentation

PropertyBag RTT::ConfigurationInterface::bag
protectedinherited

Definition at line 338 of file ConfigurationInterface.hpp.

map_t RTT::OperationInterface::data
protectedinherited

Definition at line 66 of file OperationInterface.hpp.

std::string RTT::Service::mdescription
protectedinherited

Definition at line 571 of file Service.hpp.

std::string RTT::Service::mname
protectedinherited

Definition at line 570 of file Service.hpp.

TaskContext* RTT::Service::mowner
protectedinherited
Ports RTT::DataFlowInterface::mports
protectedinherited
Service* RTT::DataFlowInterface::mservice
protectedinherited
OperationList RTT::Service::ownedoperations
protectedinherited

Definition at line 569 of file Service.hpp.

Referenced by RTT::Service::clear(), and RTT::Service::removeOperation().

shared_ptr RTT::Service::parent
protectedinherited

Definition at line 573 of file Service.hpp.

Referenced by RTT::Service::setParent().

ProgMap RTT::scripting::ScriptingService::programs
protected
Services RTT::Service::services
protectedinherited
SimpleOperations RTT::Service::simpleoperations
protectedinherited
StatementProcessor* RTT::scripting::ScriptingService::sproc
protected

Definition at line 548 of file ScriptingService.hpp.

Referenced by execute(), and ~ScriptingService().

StateMap RTT::scripting::ScriptingService::states
protected
map_t RTT::ConfigurationInterface::values
protectedinherited
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().


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