RTT::Event< SignatureT > Class Template Reference
[Event Interface.Task Context Interface]

The Orocos Event is a thread-safe publish-subscribe implementation and provides synchronous and asynchronous callback handling. More...

#include <rtt/Event.hpp>

Inheritance diagram for RTT::Event< SignatureT >:
RTT::NameServerRegistrator< Event< SignatureT > * >

List of all members.

Public Types

typedef
EventProcessor::AsynStorageType 
AsynStorageType
typedef boost::function
< SignatureT > 
SlotFunction
typedef Event< SignatureT > EventType
typedef SignatureT Signature
typedef boost::function_traits
< SignatureT >::result_type 
result_type
 The result type of the function signature.

Public Member Functions

 Event (const std::string name)
 Create a named Synchronous/Asynchronous Event.
 Event ()
 Create a Synchronous/Asynchronous Event.
 Event (const Event &m)
 Event objects may be copied.
Eventoperator= (const Event &m)
 Event objects may be assigned.
 Event (boost::shared_ptr< ActionInterface > implementation)
 Initialise a nameless Event object from an implementation.
Eventoperator= (boost::shared_ptr< ActionInterface > implementation)
 Event objects may be assigned to an implementation.
bool ready () const
 Check if this Event is ready for execution.
const std::string & getName () const
 Returns the name of this event, given upon construction.
int arity () const
 Return the arity of this event.
Handle connect (const SlotFunction &f)
 Connect a synchronous event slot to this event.
Handle connect (const SlotFunction &l, EventProcessor *ep, AsynStorageType t=EventProcessor::OnlyFirst)
 Connect an Asynchronous event slot to this event.
Handle setup (const SlotFunction &f)
 Setup a synchronous event slot to this event.
Handle setup (const SlotFunction &l, EventProcessor *ep, AsynStorageType t=EventProcessor::OnlyFirst)
 Setup an Asynchronous event slot to this event.
EventBasePtr getImplementation () const

Static Public Attributes

static NameServer< EventType * > nameserver
 Public nameserver for Events.

Detailed Description

template<typename SignatureT>
class RTT::Event< SignatureT >

The Orocos Event is a thread-safe publish-subscribe implementation and provides synchronous and asynchronous callback handling.

Use connect() to immediately connect a callback function to this Event. The returned Handle object can be used to disconnect/reconnect it lateron.

Use setup() to setup a connection of a callback function with this Event, but leave it in a dormant state. Use the returned Handle object and connect() to establish the connection.

Emit (call,raise, fire) the event by writing:

 my_event(a, b, c);
Parameters:
SignatureT The function type signature of the callback functions this event will call. For example void(int, double) if you want the event to call a function 'void foo(int x, double y)';
See also:
The Orocos CoreLib manual for usage.
Todo:
Remove NameServer functionality, as this is deprecated by the EventService class.

Definition at line 84 of file Event.hpp.


Member Typedef Documentation

template<typename SignatureT>
typedef EventProcessor::AsynStorageType RTT::Event< SignatureT >::AsynStorageType
See also:
EventProcessor::AsynStorageType

Definition at line 100 of file Event.hpp.


Constructor & Destructor Documentation

template<typename SignatureT>
RTT::Event< SignatureT >::Event ( const Event< SignatureT > &  m  )  [inline]

Event objects may be copied.

Parameters:
m the original

Definition at line 135 of file Event.hpp.

template<typename SignatureT>
RTT::Event< SignatureT >::Event ( boost::shared_ptr< ActionInterface implementation  )  [inline]

Initialise a nameless Event object from an implementation.

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

Definition at line 162 of file Event.hpp.


Member Function Documentation

template<typename SignatureT>
Event& RTT::Event< SignatureT >::operator= ( boost::shared_ptr< ActionInterface implementation  )  [inline]

Event objects may be assigned to an implementation.

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

Definition at line 179 of file Event.hpp.

template<typename SignatureT>
Event& RTT::Event< SignatureT >::operator= ( const Event< SignatureT > &  m  )  [inline]

Event objects may be assigned.

Parameters:
m the original
Returns:
*this

Definition at line 147 of file Event.hpp.

template<typename SignatureT>
bool RTT::Event< SignatureT >::ready (  )  const [inline]

Check if this Event is ready for execution.

Returns:
true if so.

Definition at line 195 of file Event.hpp.


Member Data Documentation

template<typename SignatureT>
NameServer< Event< SignatureT > * > RTT::Event< SignatureT >::nameserver [inline, static]

Public nameserver for Events.

See also:
also EventService for a 'type-less'/universal Event nameserver.

Definition at line 248 of file Event.hpp.


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