Public Member Functions | Private Member Functions | Private Attributes | List of all members
RTT::Operation< Signature > Class Template Reference

#include <OperationBase.hpp>

Inheritance diagram for RTT::Operation< Signature >:
Inheritance graph
[legend]

Public Member Functions

Operation< Signature > & arg (const std::string &name, const std::string &description)
 
Operationcalls (boost::function< Signature > func, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL)
 
template<class Function , class Object >
Operationcalls (Function func, Object o, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL)
 
Operation< Signature > & doc (const std::string &description)
 
virtual base::DisposableInterface::shared_ptr getImplementation ()
 
virtual const base::DisposableInterface::shared_ptr getImplementation () const
 
virtual base::OperationCallerBase< Signature >::shared_ptr getOperationCaller ()
 
virtual const base::OperationCallerBase< Signature >::shared_ptr getOperationCaller () const
 
 Operation (const std::string &name)
 
 Operation (const std::string &name, boost::function< Signature > func, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL)
 
template<class Function , class Object >
 Operation (const std::string &name, Function func, Object o, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL)
 
 ~Operation ()
 
- Public Member Functions inherited from RTT::base::OperationBase
const std::vector< std::string > & getDescriptions ()
 
const std::string & getName ()
 
ExecutionEnginegetOwner () const
 
RTT_API OperationBase (const std::string &name)
 
bool ready () const
 
void setOwner (ExecutionEngine *ee)
 
virtual RTT_API ~OperationBase ()
 

Private Member Functions

virtual void ownerUpdated ()
 

Private Attributes

internal::LocalOperationCaller< Signature >::shared_ptr impl
 

Additional Inherited Members

- Protected Member Functions inherited from RTT::base::OperationBase
RTT_API void marg (const std::string &name, const std::string &description)
 
RTT_API void mdoc (const std::string &description)
 
- Protected Attributes inherited from RTT::base::OperationBase
std::vector< std::string > descriptions
 
std::string mname
 
ExecutionEnginemowner
 

Detailed Description

template<class Signature>
class RTT::Operation< Signature >

The operation ties a C or C++ function into a component interface. An operation consists of a name and a Signature.

For example, if you want his operation to call a function: bool foo(int a, double b) { return a < b; } Then the function Signature looks like: 'bool(int,double)' which is the signature type of 'bool foo(int a, double b)'. So a function signature is written as the function declaration, but without the function and argument names.

Parameters
SignatureA template parameter that contains the function signature type of the function this operation object will call.

Definition at line 52 of file OperationBase.hpp.

Constructor & Destructor Documentation

template<class Signature>
RTT::Operation< Signature >::Operation ( const std::string &  name)
inline

Create an operation object with a name. The resulting object will not call any function but can be used to attach Signal handlers to (using signals() ) or set the function to call later on with calls().

Parameters
nameThe name of this instance.
Postcondition
The resulting operation will have ClientThread execution semantics.

Definition at line 83 of file Operation.hpp.

template<class Signature>
RTT::Operation< Signature >::Operation ( const std::string &  name,
boost::function< Signature >  func,
ExecutionThread  et = ClientThread,
ExecutionEngine ownerEngine = NULL 
)
inline

Create an operation object with a name and function to execute.

Parameters
nameThe name of this instance.
funcThe function to execute, for example &foo.
etThe thread that should execute the function when the operation is invoked.
ownerEnginethe execution engine of the owner of this operation if any. Will be automatically set when you use Service::addOperation().

Definition at line 98 of file Operation.hpp.

template<class Signature>
template<class Function , class Object >
RTT::Operation< Signature >::Operation ( const std::string &  name,
Function  func,
Object  o,
ExecutionThread  et = ClientThread,
ExecutionEngine ownerEngine = NULL 
)
inline

Create an operation object with a name and class member function to execute.

Parameters
nameThe name of this instance.
funcThe function to execute, for example &Bar::foo
oThe object that has this function, for example &bar
etThe thread that should execute the function when the operation is invoked.
ownerEnginethe execution engine of the owner of this operation if any. Will be automatically set when you use Service::addOperation().

Definition at line 113 of file Operation.hpp.

template<class Signature>
RTT::Operation< Signature >::~Operation ( )
inline

Definition at line 119 of file Operation.hpp.

Member Function Documentation

template<class Signature>
Operation<Signature>& RTT::Operation< Signature >::arg ( const std::string &  name,
const std::string &  description 
)
inline

Document an argument of this operation. Each time arg() is called, it documents the next argument.

Parameters
nameA single word (identifier) denoting the name of this argument
descriptionA descriptive line of text for this argument
Returns
A reference to this object.

Definition at line 137 of file Operation.hpp.

template<class Signature>
Operation& RTT::Operation< Signature >::calls ( boost::function< Signature >  func,
ExecutionThread  et = ClientThread,
ExecutionEngine ownerEngine = NULL 
)
inline

Indicate that this operation calls a given function. This will replace any previously registered function present in this operation.

Parameters
funcThe function to call when the operation is invoked
etThe thread that should execute the function when the operation is invoked.
ownerEnginethe execution engine of the owner of this operation if any.
Returns
A reference to this object.

Definition at line 147 of file Operation.hpp.

template<class Signature>
template<class Function , class Object >
Operation& RTT::Operation< Signature >::calls ( Function  func,
Object  o,
ExecutionThread  et = ClientThread,
ExecutionEngine ownerEngine = NULL 
)
inline

Indicate that this operation calls a given class member function. This will replace any previously registered function present in this operation.

Parameters
funcThe function to call when the operation is invoked, for example &Bar::foo
oThe object that has this function, for example &bar
etThe thread that should execute the function when the operation is invoked.
ownerEnginethe execution engine of the owner of this operation if any.
Returns
A reference to this object.

Definition at line 168 of file Operation.hpp.

template<class Signature>
Operation<Signature>& RTT::Operation< Signature >::doc ( const std::string &  description)
inline

Document this operation.

Parameters
descriptionA descriptive line of text.
Returns
A reference to this object.

Definition at line 128 of file Operation.hpp.

template<class Signature>
virtual base::DisposableInterface::shared_ptr RTT::Operation< Signature >::getImplementation ( )
inlinevirtual

Returns the implementation object of this operation.

Returns

Implements RTT::base::OperationBase.

Definition at line 226 of file Operation.hpp.

template<class Signature>
virtual const base::DisposableInterface::shared_ptr RTT::Operation< Signature >::getImplementation ( ) const
inlinevirtual

Implements RTT::base::OperationBase.

Definition at line 227 of file Operation.hpp.

template<class Signature>
virtual base::OperationCallerBase<Signature>::shared_ptr RTT::Operation< Signature >::getOperationCaller ( )
inlinevirtual

Definition at line 229 of file Operation.hpp.

template<class Signature>
virtual const base::OperationCallerBase<Signature>::shared_ptr RTT::Operation< Signature >::getOperationCaller ( ) const
inlinevirtual

Definition at line 230 of file Operation.hpp.

template<class Signature>
virtual void RTT::Operation< Signature >::ownerUpdated ( )
inlineprivatevirtual

Implements RTT::base::OperationBase.

Definition at line 243 of file Operation.hpp.

Member Data Documentation

template<class Signature>
internal::LocalOperationCaller<Signature>::shared_ptr RTT::Operation< Signature >::impl
private

Definition at line 242 of file Operation.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:46