Orocos Real-Time Toolkit
2.9.0
|
Holds all exported operations of a component and is able to produce callers for these operations. More...
#include <rtt/OperationInterface.hpp>
Public Types | |
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... | |
Public Member Functions | |
void | clear () |
Remove and delete all added operations. 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... | |
Protected Types | |
typedef std::map< std::string, OperationInterfacePart * > | map_t |
Protected Attributes | |
map_t | data |
Holds all exported operations of a component and is able to produce callers for these operations.
Definition at line 62 of file OperationInterface.hpp.
typedef std::vector<base::DataSourceBase::shared_ptr> RTT::OperationInterface::Arguments |
The arguments for an operation.
Definition at line 71 of file OperationInterface.hpp.
typedef std::vector<ArgumentDescription> RTT::OperationInterface::Descriptions |
The descriptions of an argumentlist.
Definition at line 204 of file OperationInterface.hpp.
|
protected |
Definition at line 65 of file OperationInterface.hpp.
void OperationInterface::add | ( | const std::string & | name, |
OperationInterfacePart * | part | ||
) |
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.
void OperationInterface::clear | ( | ) |
Remove and delete all added operations.
Definition at line 58 of file OperationInterface.cpp.
Referenced by RTT::Service::clear().
OperationInterface::Descriptions OperationInterface::getArgumentList | ( | const std::string & | name | ) | const |
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.
int OperationInterface::getArity | ( | const std::string & | name | ) | const |
Query the number of arguments of an operation.
These are the number of function arguments, not counting the return value.
name | The name of the operation |
Definition at line 77 of file OperationInterface.cpp.
int OperationInterface::getCollectArity | ( | const std::string & | name | ) | const |
Query the collectable number of arguments of an operation.
These are the return value (if non void) and each non-const reference argument of the operation.
name | The name of the operation |
Definition at line 85 of file OperationInterface.cpp.
std::string OperationInterface::getDescription | ( | const std::string & | name | ) | const |
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.
std::vector< std::string > OperationInterface::getNames | ( | ) | const |
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 * OperationInterface::getPart | ( | const std::string & | name | ) |
Get a previously added part of this factory.
name |
Definition at line 188 of file OperationInterface.cpp.
Referenced by RTT::Service::create(), RTT::Service::getOperation(), and RTT_corba_COperationInterface_i::sendOperationOneway().
std::string OperationInterface::getResultType | ( | const std::string & | name | ) | const |
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.
bool OperationInterface::hasMember | ( | const std::string & | name | ) | const |
Query if an operation is present.
Definition at line 72 of file OperationInterface.cpp.
Referenced by RTT::Service::getOperation().
bool OperationInterface::isSynchronous | ( | const std::string & | name | ) | const |
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().
base::DataSourceBase::shared_ptr OperationInterface::produce | ( | const std::string & | name, |
const Arguments & | args, | ||
ExecutionEngine * | caller | ||
) | const |
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.
base::DataSourceBase::shared_ptr OperationInterface::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.
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.
base::DataSourceBase::shared_ptr OperationInterface::produceHandle | ( | const std::string & | name | ) | const |
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.
base::DataSourceBase::shared_ptr OperationInterface::produceSend | ( | const std::string & | name, |
const Arguments & | args, | ||
ExecutionEngine * | caller | ||
) | const |
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.
void OperationInterface::remove | ( | const std::string & | name | ) |
Remove an added operation from the interface.
name | The name of the operation |
Definition at line 178 of file OperationInterface.cpp.
Referenced by RTT::Service::removeOperation().
|
protected |
Definition at line 66 of file OperationInterface.hpp.