RTT::CommandFunctor< F > Class Template Reference

A Command which can be bound to a function using boost::bind. More...

#include <rtt/CommandFunctor.hpp>

Inherits RTT::Corba::CommandInterface.

List of all members.

Public Types

typedef F Function
typedef CommandInterface_ptr _ptr_type
typedef CommandInterface_var _var_type
typedef CommandInterface_out _out_type

Public Member Functions

 CommandFunctor (const Function &func)
 Create a command calling a function.
virtual void readArguments ()
virtual bool execute ()
virtual CommandInterfaceclone () const
virtual ::RTT::Corba::CommandList * getCommands (void)
virtual
::RTT::Corba::Descriptions * 
getArguments (const char *command)
virtual char * getResultType (const char *command)
virtual char * getDescription (const char *command)
virtual ::RTT::Corba::Command_ptr createCommand (const char *command, const ::RTT::Corba::Arguments &args)
virtual ::RTT::Corba::Command_ptr createCommandAny (const char *command, const ::RTT::Corba::AnyArguments &args)
virtual ::CORBA::Boolean _is_a (const char *type_id)
virtual const char * _interface_repository_id (void) const
virtual ::CORBA::Boolean marshal (TAO_OutputCDR &cdr)

Static Public Member Functions

static CommandInterface_ptr _duplicate (CommandInterface_ptr obj)
static void _tao_release (CommandInterface_ptr obj)
static CommandInterface_ptr _narrow (::CORBA::Object_ptr obj)
static CommandInterface_ptr _unchecked_narrow (::CORBA::Object_ptr obj)
static CommandInterface_ptr _nil (void)
static void _tao_any_destructor (void *)

Protected Member Functions

virtual void RTT_Corba_CommandInterface_setup_collocation (void)

Friends

class TAO::Narrow_Utils< CommandInterface >

Detailed Description

template<class F>
class RTT::CommandFunctor< F >

A Command which can be bound to a function using boost::bind.

See the boost::bind documentation (www.boost.org) for more examples. execute() will always return true. To have it return the boolean result of the bound function, a boost::function<bool(void)> object must be given. See the Commandfunctor specialisation class.

Usage :

     * void myFun(void);
     * bool myFun( ClassA* a );
     * ClassA* _class;
     *
     * // Watch the 'newCommandFunctor' _function_ :
     * CommandInterface* c,d;
     * c = newCommandFunctor( boost::bind( &myFun ) );
     * c->execute(); // calls myFun();
     * d = newCommandFunctor( boost::bind(&myFun2, _class) );
     * d->execute(); // calls myFun2( _class );
     * 

Definition at line 70 of file CommandFunctor.hpp.


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