RTT::Method< FunctionT > Class Template Reference
[Task Context InterfaceMethod Interface]

A method which executes a function. More...

#include <rtt/Method.hpp>

List of all members.

Public Types

typedef FunctionT Signature
typedef boost::function_traits
< Signature >::result_type 
result_type
typedef boost::function_traits
< Signature > 
traits
typedef boost::shared_ptr
< detail::MethodBase
< FunctionT > > 
MethodBasePtr

Public Member Functions

 Method ()
 Create an empty Method object.
 Method (std::string name)
 Create an empty Method object.
 Method (const Method &m)
 Method objects may be copied.
Method & operator= (const Method &m)
 Method objects may be assigned.
 Method (boost::shared_ptr< ActionInterface > implementation)
 Initialise a nameless Method object from an implementation.
Method & operator= (boost::shared_ptr< ActionInterface > implementation)
 Method objects may be assigned to an implementation.
template<class M , class ObjectType >
 Method (std::string name, M meth, ObjectType object)
 Construct a Method from a class member pointer and an object of that class.
template<class M >
 Method (std::string name, M meth)
 Construct a Method from a function pointer or function object.
 ~Method ()
 Clean up the Method object.
bool ready () const
 Check if this Method is ready for execution.
const std::string & getName () const
 Get the name of this method.
const MethodBasePtr getMethodImpl () const
 Returns the internal implementation of the Method object.
void setMethodImpl (MethodBasePtr new_impl) const
 Sets the internal implementation of the Method object.
template<class M , class ObjectType >
void setMethod (M meth, ObjectType object)
 Assign a class member pointer and an object of that class to the Method.
template<class M >
void setMethod (M meth)
 Assign a function pointer or function object to the Method.

Detailed Description

template<class FunctionT>
class RTT::Method< FunctionT >

A method which executes a function.

Usage:

     Method<double(int, double)> mymeth("name", &Class::foo, &c);
     double result = mymeth( 3, 1.9);

Definition at line 71 of file Method.hpp.


Constructor & Destructor Documentation

template<class FunctionT >
RTT::Method< FunctionT >::Method (  )  [inline]

Create an empty Method object.

Use assignment to initialise it.

See also:
method

Definition at line 91 of file Method.hpp.

References RTT::Method< FunctionT >::Method().

Referenced by RTT::Method< FunctionT >::Method(), RTT::Method< FunctionT >::operator=(), and RTT::Method< FunctionT >::~Method().

template<class FunctionT >
RTT::Method< FunctionT >::Method ( std::string  name  )  [inline]

Create an empty Method object.

Use assignment to initialise it.

See also:
method

Definition at line 100 of file Method.hpp.

References RTT::Method< FunctionT >::Method().

template<class FunctionT >
RTT::Method< FunctionT >::Method ( const Method< FunctionT > &  m  )  [inline]

Method objects may be copied.

Parameters:
m the original

Definition at line 109 of file Method.hpp.

References RTT::Method< FunctionT >::Method().

template<class FunctionT >
RTT::Method< FunctionT >::Method ( boost::shared_ptr< ActionInterface implementation  )  [inline]

Initialise a nameless Method object from an implementation.

Parameters:
implementation The implementation which is acquired by the Method object. If it has the wrong type, it is freed.

Definition at line 136 of file Method.hpp.

References RTT::Method< FunctionT >::Method().

template<class FunctionT >
template<class M , class ObjectType >
RTT::Method< FunctionT >::Method ( std::string  name,
meth,
ObjectType  object 
) [inline]

Construct a Method from a class member pointer and an object of that class.

Parameters:
name The name of this method
meth A pointer to a class member function
object An object of the class which has meth as member function.

Definition at line 173 of file Method.hpp.

References RTT::Method< FunctionT >::Method().

template<class FunctionT >
template<class M >
RTT::Method< FunctionT >::Method ( std::string  name,
meth 
) [inline]

Construct a Method from a function pointer or function object.

Parameters:
name the name of this method
meth an pointer to a function or function object.

Definition at line 185 of file Method.hpp.

References RTT::Method< FunctionT >::Method().


Member Function Documentation

template<class FunctionT >
Method& RTT::Method< FunctionT >::operator= ( boost::shared_ptr< ActionInterface implementation  )  [inline]

Method objects may be assigned to an implementation.

Parameters:
implementation the implementation, if it is not suitable, it is freed.
Returns:
*this

Definition at line 153 of file Method.hpp.

References RTT::Method< FunctionT >::Method(), and RTT::Method< FunctionT >::operator=().

template<class FunctionT >
Method& RTT::Method< FunctionT >::operator= ( const Method< FunctionT > &  m  )  [inline]

Method objects may be assigned.

Parameters:
m the original
Returns:
*this

Definition at line 121 of file Method.hpp.

References RTT::Method< FunctionT >::Method(), and RTT::Method< FunctionT >::operator=().

Referenced by RTT::Method< FunctionT >::operator=().

template<class FunctionT >
bool RTT::Method< FunctionT >::ready (  )  const [inline]

Check if this Method is ready for execution.

Returns:
true if so.

Definition at line 202 of file Method.hpp.

template<class FunctionT >
template<class M >
void RTT::Method< FunctionT >::setMethod ( meth  )  [inline]

Assign a function pointer or function object to the Method.

Does not change the Method's name.

Use getMethodImpl() to retrieve the resulting implementation.

Parameters:
meth A pointer to a class member function
object An object of the class which has meth as member function.

Definition at line 251 of file Method.hpp.

References RTT::Method< FunctionT >::setMethod().

template<class FunctionT >
template<class M , class ObjectType >
void RTT::Method< FunctionT >::setMethod ( meth,
ObjectType  object 
) [inline]

Assign a class member pointer and an object of that class to the Method.

Does not change the Method's name.

Use getMethodImpl() to retrieve the resulting implementation.

Parameters:
meth A pointer to a class member function
object An object of the class which has meth as member function.

Definition at line 236 of file Method.hpp.

References RTT::Method< FunctionT >::setMethod().

Referenced by RTT::Method< FunctionT >::setMethod().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:43 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3