Orocos Real-Time Toolkit
2.9.0
|
This class allows storage and retrieval of operations, ports, attributes and properties provided by a component. More...
#include <rtt/Service.hpp>
Public Types | |
typedef OperationInterface | Factory |
typedef boost::shared_ptr< Service > | shared_ptr |
typedef boost::shared_ptr< const Service > | shared_constptr |
typedef std::vector< std::string > | ProviderNames |
typedef std::vector< base::DataSourceBase::shared_ptr > | Arguments |
The arguments for an operation. More... | |
typedef std::vector< ArgumentDescription > | Descriptions |
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 | |
Service (const std::string &name, TaskContext *owner=0) | |
Creates a Service with a name and an owner. More... | |
virtual | ~Service () |
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... | |
TaskContext * | getOwner () const |
The owner is the top-level TaskContext owning this service (indirectly). More... | |
ExecutionEngine * | getOwnerExecutionEngine () 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... | |
bool | hasService (const std::string &service_name) |
Check if this service has the sub-service service_name. More... | |
void | clear () |
Clear all added operations, properties and sub-services from this Service. 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::DisposableInterface > | getLocalOperation (std::string name) |
Get a locally added operation from this interface. More... | |
OperationInterfacePart * | getOperation (std::string name) |
Get a previously added operation for use in a C++ OperationCaller object. 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 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 > & | 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 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... | |
base::DataSourceBase::shared_ptr | getOperation (std::string name, const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const |
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... | |
OperationInterfacePart * | getPart (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::AttributeBase * | getAttribute (const std::string &name) const |
void | removeAttribute (const std::string &name) |
Remove an attribute from the repository. More... | |
base::AttributeBase * | getConstant (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::PropertyBase * | getProperty (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::AttributeBase * | getValue (const std::string &name) const |
bool | removeValue (const std::string &name) |
Delete a value added with setValue from the repository. More... | |
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. 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... | |
PropertyBag * | properties () |
Return a bag of all properties. More... | |
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. More... | |
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. More... | |
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. More... | |
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. 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::PortInterface * | getPort (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... | |
Service * | getService () const |
Returns the service this interface belongs to. More... | |
base::PortInterface & | addLocalPort (base::PortInterface &port) |
Add a Port to this task without registering a service for it. More... | |
base::InputPortInterface & | addLocalEventPort (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... | |
Static Public Member Functions | |
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, 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 | testOperation (base::OperationBase &op) |
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. More... | |
bool | chkPtr (const std::string &where, const std::string &name, const void *ptr) |
Protected Attributes | |
Services | services |
the services we implement. More... | |
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. More... | |
Service * | mservice |
The parent Service. More... | |
This class allows storage and retrieval of operations, ports, attributes and properties provided by a component.
Services can be nested in sub-services, but all sub-services will be owned by the same TaskContext.
Definition at line 93 of file Service.hpp.
|
inherited |
The arguments for an operation.
Definition at line 71 of file OperationInterface.hpp.
|
inherited |
A vector containing the names of all attribute objects in this repository.
Definition at line 74 of file ConfigurationInterface.hpp.
|
inherited |
A vector containing pointers to all attribute objects stored in this repository.
Definition at line 80 of file ConfigurationInterface.hpp.
|
inherited |
The descriptions of an argumentlist.
Definition at line 204 of file OperationInterface.hpp.
Definition at line 100 of file Service.hpp.
|
protectedinherited |
Definition at line 65 of file OperationInterface.hpp.
|
protectedinherited |
Definition at line 336 of file ConfigurationInterface.hpp.
|
protected |
Definition at line 567 of file Service.hpp.
|
inherited |
A sequence of names of ports.
Definition at line 70 of file DataFlowInterface.hpp.
|
inherited |
A sequence of pointers to ports.
Definition at line 65 of file DataFlowInterface.hpp.
typedef std::vector<std::string> RTT::Service::ProviderNames |
Definition at line 103 of file Service.hpp.
|
protected |
Definition at line 561 of file Service.hpp.
typedef boost::shared_ptr<const Service> RTT::Service::shared_constptr |
Definition at line 102 of file Service.hpp.
typedef boost::shared_ptr<Service> RTT::Service::shared_ptr |
Definition at line 101 of file Service.hpp.
|
protected |
Definition at line 566 of file Service.hpp.
|
inherited |
Definition at line 72 of file DataFlowInterface.hpp.
RTT::Service::Service | ( | const std::string & | name, |
TaskContext * | owner = 0 |
||
) |
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 57 of file Service.cpp.
References RTT::DataFlowInterface::mservice.
|
virtual |
Definition at line 66 of file Service.cpp.
References clear().
|
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.
|
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.
name | The name of this attribute |
attr | The variable that will be aliased. |
Definition at line 101 of file ConfigurationInterface.hpp.
|
inlineinherited |
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().
|
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.
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().
|
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.
name | The name of this attribute |
cnst | The variable that will be aliased. |
Definition at line 135 of file ConfigurationInterface.hpp.
|
inlineinherited |
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().
|
inlineinherited |
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().
|
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.
name | The name to give to the port. |
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 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().
|
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.
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 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 97 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::addLocalEventPort(), addService(), RTT::DataFlowInterface::chkPtr(), RTT::Handle::connect(), RTT::DataFlowInterface::createPortObject(), RTT::Handle::disconnect(), RTT::base::PortInterface::getName(), hasService(), RTT::DataFlowInterface::mservice, provides(), removeService(), and RTT::Warning.
|
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 135 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::addLocalPort(), RTT::Error, RTT::base::PortInterface::getName(), getName(), 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 | ) |
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 178 of file Service.cpp.
References RTT::base::TaskCore::engine(), RTT::Error, RTT::base::OperationBase::getImplementation(), RTT::base::OperationBase::getName(), mowner, removeOperation(), RTT::base::OperationBase::setOwner(), simpleoperations, and RTT::Warning.
|
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 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().
|
inline |
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 341 of file Service.hpp.
References RTT::base::OperationBase::getName().
Referenced by RTT::scripting::ScriptingService::createInterface(), and RTT::marsh::MarshallingService::MarshallingService().
|
inline |
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.
name | The name of the new operation |
func | A pointer to a function, for example, &Bar::foo (C++ class function). |
obj | 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 402 of file Service.hpp.
|
inline |
Add an operation to the interface by means of a free C/C++ function.
The function func must be a free C/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 423 of file Service.hpp.
References RTT::ClientThread.
|
inline |
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().
|
inline |
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().
|
inlineinherited |
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().
|
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(), addService(), RTT::DataFlowInterface::chkPtr(), RTT::DataFlowInterface::createPortObject(), RTT::base::PortInterface::getName(), hasService(), RTT::DataFlowInterface::mservice, provides(), removeService(), and RTT::Warning.
|
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.
name | The name of this property |
prop | The variable that will be aliased. |
Definition at line 171 of file ConfigurationInterface.hpp.
Referenced by RTT::scripting::ScriptingService::ScriptingService().
|
inlineinherited |
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().
|
inherited |
Add an base::PropertyBase as a property.
Definition at line 90 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
|
virtual |
Add a new sub-service to this Service.
obj | This object becomes owned by this Service. |
Definition at line 81 of file Service.cpp.
References RTT::Error, mowner, and services.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), and provides().
|
inline |
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 379 of file Service.hpp.
References RTT::base::OperationBase::getName().
Referenced by RTT::base::PortInterface::createPortObject().
|
inline |
Add an operation to the synchronous interface by means of a function.
The function func must be a C++ Class member function.
name | The name of the new operation |
func | A pointer to a function, for example &Bar::foo (C++ class function). |
obj | 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 492 of file Service.hpp.
|
protectedinherited |
Definition at line 265 of file DataFlowInterface.cpp.
References RTT::Error.
Referenced by RTT::DataFlowInterface::addEventPort(), and RTT::DataFlowInterface::addPort().
|
protectedinherited |
Definition at line 156 of file ConfigurationInterface.cpp.
References RTT::Error.
void RTT::Service::clear | ( | ) |
Clear all added operations, properties and sub-services from this Service.
Definition at line 210 of file Service.cpp.
References RTT::OperationInterface::clear(), RTT::ConfigurationInterface::clear(), ownedoperations, removeService(), services, and simpleoperations.
Referenced by RTT::scripting::ScriptingService::clear(), and ~Service().
|
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(), and RTT::internal::values().
Referenced by RTT::scripting::StateMachineService::copy().
|
static |
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 50 of file Service.cpp.
References RTT::TaskContext::provides().
internal::OperationCallerC RTT::Service::create | ( | std::string | name, |
ExecutionEngine * | caller | ||
) |
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 268 of file Service.cpp.
References RTT::OperationInterface::getPart().
|
protectedinherited |
Create a Service through which one can access a Port.
name | The port name |
Definition at line 238 of file DataFlowInterface.cpp.
References RTT::base::PortInterface::createPortObject(), doc(), RTT::DataFlowInterface::getPort(), and RTT::DataFlowInterface::getPortDescription().
Referenced by RTT::DataFlowInterface::addEventPort(), and RTT::DataFlowInterface::addPort().
|
inherited |
Used by the input ports to notify this class of new data.
Definition at line 128 of file DataFlowInterface.cpp.
References getOwner(), and RTT::DataFlowInterface::mservice.
|
inline |
Returns a descriptive text for this service.
Definition at line 144 of file Service.hpp.
Referenced by RTT::DataFlowInterface::createPortObject(), RTT::marsh::MarshallingService::MarshallingService(), RTT::scripting::ProgramService::ProgramService(), and RTT::scripting::ScriptingService::ScriptingService().
|
inline |
Sets the descriptive text for this service.
Definition at line 149 of file Service.hpp.
|
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.
References ORO_THROW_OR_RETURN.
|
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.
|
inlineinherited |
Definition at line 218 of file ConfigurationInterface.hpp.
Referenced by RTT_corba_CConfigurationInterface_i::getAttributeDataSource().
|
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().
|
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.
|
inlineinherited |
Definition at line 245 of file ConfigurationInterface.hpp.
References RTT::removeProperty().
|
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.
References ORO_THROW_OR_RETURN.
boost::shared_ptr< base::DisposableInterface > RTT::Service::getLocalOperation | ( | std::string | name | ) |
Get a locally added operation from this interface.
Definition at line 203 of file Service.cpp.
References hasOperation(), and simpleoperations.
|
inline |
Returns the name of this service instance.
Definition at line 139 of file Service.hpp.
Referenced by RTT::DataFlowInterface::addLocalEventPort(), getOperation(), RTT::marsh::PropertyLoader::load(), RTT::marsh::MarshallingService::loadServiceProperties(), RTT::marsh::MarshallingService::readServiceProperties(), RTT::marsh::MarshallingService::readServiceProperty(), RTT::marsh::PropertyLoader::store(), RTT::marsh::MarshallingService::storeServiceProperties(), RTT::marsh::MarshallingService::updateServiceFile(), RTT::marsh::MarshallingService::updateServiceProperties(), RTT::marsh::MarshallingService::writeServiceProperties(), and RTT::marsh::MarshallingService::writeServiceProperty().
|
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 | ) |
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 142 of file Service.cpp.
References getName(), RTT::OperationInterface::getPart(), RTT::OperationInterface::hasMember(), and RTT::Warning.
Referenced by setOperationThread().
|
inline |
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 540 of file Service.hpp.
std::vector< std::string > RTT::Service::getOperationNames | ( | ) | const |
Returns the names of all operations added to this interface.
Definition at line 230 of file Service.cpp.
References RTT::internal::keys(), and simpleoperations.
|
inline |
The owner is the top-level TaskContext owning this service (indirectly).
A Service can only belong to one TaskContext.
Definition at line 185 of file Service.hpp.
Referenced by RTT::DataFlowInterface::addLocalEventPort(), RTT::DataFlowInterface::dataOnPort(), RTT::DataFlowInterface::getOwner(), getOwnerExecutionEngine(), RTT::scripting::ScriptingService::loadProgram(), RTT::scripting::ScriptingService::loadStateMachine(), RTT::DataFlowInterface::removePort(), and setOperationThread().
ExecutionEngine * RTT::Service::getOwnerExecutionEngine | ( | ) | const |
Return the execution engine of this service owner.
Definition at line 75 of file Service.cpp.
References RTT::base::TaskCore::engine(), and getOwner().
|
inline |
The parent is the direct parent of this service.
Definition at line 171 of file Service.hpp.
Referenced by RTT::marsh::MarshallingService::loadProperties(), RTT::marsh::MarshallingService::loadServiceProperties(), RTT::marsh::MarshallingService::readProperties(), RTT::marsh::MarshallingService::readProperty(), RTT::marsh::MarshallingService::readServiceProperties(), RTT::marsh::MarshallingService::readServiceProperty(), RTT::marsh::MarshallingService::storeProperties(), RTT::marsh::MarshallingService::storeServiceProperties(), RTT::marsh::MarshallingService::updateFile(), RTT::marsh::MarshallingService::updateProperties(), RTT::marsh::MarshallingService::updateServiceFile(), RTT::marsh::MarshallingService::updateServiceProperties(), RTT::marsh::MarshallingService::writeProperties(), RTT::marsh::MarshallingService::writeProperty(), RTT::marsh::MarshallingService::writeServiceProperties(), and RTT::marsh::MarshallingService::writeServiceProperty().
|
inherited |
Get a previously added part of this factory.
name |
Definition at line 188 of file OperationInterface.cpp.
Referenced by create(), getOperation(), and RTT_corba_COperationInterface_i::sendOperationOneway().
|
inherited |
Get an added port.
name | The port name |
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().
|
inherited |
Get the description of an added Port.
name | The port name |
Definition at line 220 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::DataFlowInterface::createPortObject().
|
inherited |
Get all port names of this interface.
Definition at line 202 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::corba::CDataFlowInterface_i::_default_POA().
|
inherited |
Get all ports of this interface.
Definition at line 198 of file DataFlowInterface.cpp.
References RTT::DataFlowInterface::mports.
Referenced by RTT::TaskContext::connectPorts(), and RTT::TaskContext::disconnect().
|
inlineinherited |
Get a port of a specific type.
Definition at line 244 of file DataFlowInterface.hpp.
|
inlineinherited |
Get a Property with name name.
name | The name of the property to search for. |
Definition at line 275 of file ConfigurationInterface.hpp.
|
virtual |
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 services.
|
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.
References ORO_THROW_OR_RETURN.
|
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 provides().
Service::shared_ptr RTT::Service::getService | ( | const std::string & | service_name | ) |
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.
service_name | The 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 provides(), and services.
Referenced by RTT::DataFlowInterface::setPortDescription().
|
inherited |
Definition at line 111 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT_corba_CConfigurationInterface_i::getAttribute(), RTT_corba_CConfigurationInterface_i::isAttributeAssignable(), and RTT_corba_CConfigurationInterface_i::setAttribute().
|
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().
|
inherited |
Check if an attribute is present in this interface.
Definition at line 118 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT_corba_CConfigurationInterface_i::getAttribute(), RTT_corba_CConfigurationInterface_i::hasAttribute(), and RTT_corba_CConfigurationInterface_i::setAttribute().
|
inherited |
Query if an operation is present.
Definition at line 72 of file OperationInterface.cpp.
Referenced by getOperation().
bool RTT::Service::hasOperation | ( | const std::string & | name | ) | const |
Query for the existence of a Operation in this interface.
Definition at line 236 of file Service.cpp.
References simpleoperations.
Referenced by getLocalOperation(), removeOperation(), resetOperation(), and setOperationThread().
|
inherited |
Check if a property is present.
Definition at line 124 of file ConfigurationInterface.cpp.
bool RTT::Service::hasService | ( | const std::string & | service_name | ) |
Check if this service has the sub-service service_name.
service_name | The name of the sub-service to be queried. |
Definition at line 172 of file Service.cpp.
References services.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), RTT::marsh::MarshallingService::loadServiceProperties(), RTT::marsh::MarshallingService::readServiceProperties(), RTT::marsh::MarshallingService::readServiceProperty(), RTT::DataFlowInterface::removePort(), RTT::marsh::MarshallingService::storeServiceProperties(), RTT::marsh::MarshallingService::updateServiceFile(), RTT::marsh::MarshallingService::updateServiceProperties(), RTT::marsh::MarshallingService::writeServiceProperties(), and RTT::marsh::MarshallingService::writeServiceProperty().
|
inherited |
Query if a given operation is limited to sychronous invocation (own component thread) only.
Definition at line 93 of file OperationInterface.cpp.
Referenced by RTT_corba_COperationInterface_i::getOperations(), and RTT_corba_COperationInterface_i::sendOperationOneway().
|
inherited |
Adds these attributes to this repository.
Definition at line 145 of file ConfigurationInterface.cpp.
References RTT::internal::values().
|
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.
References ORO_THROW_OR_RETURN.
|
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.
References ORO_THROW_OR_RETURN.
|
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.
References ORO_THROW_OR_RETURN.
|
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.
References ORO_THROW_OR_RETURN.
|
inherited |
Return a bag of all properties.
Definition at line 150 of file ConfigurationInterface.cpp.
Referenced by RTT_corba_CConfigurationInterface_i::getProperty(), RTT_corba_CConfigurationInterface_i::getPropertyDataSource(), RTT_corba_CConfigurationInterface_i::getPropertyList(), RTT::marsh::PropertyLoader::load(), RTT_corba_CConfigurationInterface_i::setProperty(), and RTT::marsh::PropertyLoader::store().
Service::shared_ptr RTT::Service::provides | ( | ) |
Returns this Service, unless no shared_ptr yet exists.
std::runtime_exception | when no Service::shared_ptr to this exists yet. |
Definition at line 113 of file Service.cpp.
References RTT::Error.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), getService(), RTT::marsh::MarshallingService::loadServiceProperties(), RTT::marsh::MarshallingService::readServiceProperties(), RTT::marsh::MarshallingService::readServiceProperty(), RTT::DataFlowInterface::removePort(), RTT::marsh::MarshallingService::storeServiceProperties(), RTT::marsh::MarshallingService::updateServiceFile(), RTT::marsh::MarshallingService::updateServiceProperties(), RTT::marsh::MarshallingService::writeServiceProperties(), and RTT::marsh::MarshallingService::writeServiceProperty().
Service::shared_ptr RTT::Service::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.
Use getService() if no Service object creation should be done.
service_name | The name of the sub-service to be returned or created, or the result of provides() in case of "this". |
Definition at line 123 of file Service.cpp.
References addService(), RTT::DataFlowInterface::getService(), and mowner.
|
inherited |
Remove an added operation from the interface.
name | The name of the operation |
Definition at line 178 of file OperationInterface.cpp.
Referenced by removeOperation().
|
inherited |
Remove an attribute from the repository.
Definition at line 96 of file ConfigurationInterface.cpp.
Referenced by RTT::scripting::ExpressionParser::getHandle().
|
inherited |
Remove a locally added Port from this interface.
This will remove all connections and callbacks assosiated with this port.
port | The port to remove. |
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 | ) |
Removes a previously added operation.
Definition at line 242 of file Service.cpp.
References hasOperation(), ownedoperations, RTT::OperationInterface::remove(), and simpleoperations.
Referenced by addLocalOperation().
|
inherited |
Remove a Port from this interface.
This will remove all services, connections and callbacks assosiated with this port.
port | The port to remove. |
Definition at line 165 of file DataFlowInterface.cpp.
References getOwner(), hasService(), RTT::DataFlowInterface::mports, RTT::DataFlowInterface::mservice, provides(), and removeService().
|
inherited |
Remove a previously added Property and associated attribute.
Definition at line 129 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
|
virtual |
Remove a previously added sub-service, potentially freeing it (and this) from memory.
service_name | the name of the service to remove. |
Definition at line 103 of file Service.cpp.
References services.
Referenced by RTT::DataFlowInterface::addEventPort(), RTT::DataFlowInterface::addPort(), RTT::DataFlowInterface::clear(), clear(), and RTT::DataFlowInterface::removePort().
|
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::Service::resetOperation | ( | std::string | name, |
base::OperationBase * | impl | ||
) |
Reset the implementation of a operation.
Definition at line 152 of file Service.cpp.
References hasOperation(), and simpleoperations.
|
inline |
Changes the name of this service.
Definition at line 154 of file Service.hpp.
bool RTT::Service::setOperationThread | ( | std::string const & | name, |
ExecutionThread | et | ||
) |
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 160 of file Service.cpp.
References RTT::OperationInterfacePart::getLocalOperation(), getOperation(), getOwner(), hasOperation(), and RTT::base::OperationCallerInterface::setThread().
void RTT::Service::setOwner | ( | TaskContext * | new_owner | ) |
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(), mowner, services, and simpleoperations.
Referenced by RTT::scripting::StateMachineService::StateMachineService().
void RTT::Service::setParent | ( | Service::shared_ptr | p | ) |
Sets the parent service in case this service is a sub-service.
Definition at line 264 of file Service.cpp.
References parent.
|
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 229 of file DataFlowInterface.cpp.
References getService(), and RTT::DataFlowInterface::mservice.
Referenced by RTT::base::PortInterface::doc().
|
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(), RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT::ConfigurationInterface::copy(), and RTT::scripting::ExpressionParser::getHandle().
|
protected |
|
protectedinherited |
Definition at line 338 of file ConfigurationInterface.hpp.
|
protectedinherited |
Definition at line 66 of file OperationInterface.hpp.
|
protected |
Definition at line 571 of file Service.hpp.
|
protected |
Definition at line 570 of file Service.hpp.
|
protected |
Definition at line 572 of file Service.hpp.
Referenced by addLocalOperation(), addService(), RTT::scripting::ScriptingService::evalInternal(), RTT::scripting::ScriptingService::execute(), RTT::scripting::ScriptingService::loadFunctions(), RTT::scripting::ScriptingService::loadProgram(), RTT::scripting::ScriptingService::loadPrograms(), RTT::scripting::ScriptingService::loadStateMachines(), provides(), RTT::scripting::ScriptingService::recursiveLoadStateMachine(), RTT::scripting::ScriptingService::recursiveUnloadStateMachine(), setOwner(), and RTT::scripting::ScriptingService::unloadProgram().
|
protectedinherited |
All our ports.
Definition at line 280 of file DataFlowInterface.hpp.
Referenced by RTT::DataFlowInterface::addLocalPort(), RTT::DataFlowInterface::clear(), RTT::DataFlowInterface::getPort(), RTT::DataFlowInterface::getPortDescription(), RTT::DataFlowInterface::getPortNames(), RTT::DataFlowInterface::getPorts(), RTT::DataFlowInterface::removeLocalPort(), and RTT::DataFlowInterface::removePort().
|
protectedinherited |
The parent Service.
May be null in exceptional cases.
Definition at line 284 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(), Service(), and RTT::DataFlowInterface::setPortDescription().
|
protected |
Definition at line 569 of file Service.hpp.
Referenced by clear(), and removeOperation().
|
protected |
Definition at line 573 of file Service.hpp.
Referenced by setParent().
|
protected |
the services we implement.
Definition at line 563 of file Service.hpp.
Referenced by addService(), clear(), getProviderNames(), getService(), hasService(), removeService(), and setOwner().
|
protected |
Definition at line 568 of file Service.hpp.
Referenced by addLocalOperation(), clear(), getLocalOperation(), getOperationNames(), hasOperation(), removeOperation(), resetOperation(), and setOwner().
|
protectedinherited |
Definition at line 337 of file ConfigurationInterface.hpp.
Referenced by RTT::scripting::StateMachineService::copy().