Event Class Template Reference
[Event Interface.Task Context Interface]

#include <rtt/Event.hpp>

Inheritance diagram for Event:

NameServerRegistrator

List of all members.


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.


Public Types

typedef
EventProcessor::AsynStorageType 
AsynStorageType
 
See also:
EventProcessor::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)
Handle connect (const SlotFunction &l, EventProcessor *ep, AsynStorageType t=EventProcessor::OnlyFirst)
Handle setup (const SlotFunction &f)
Handle setup (const SlotFunction &l, EventProcessor *ep, AsynStorageType t=EventProcessor::OnlyFirst)
EventBasePtr getImplementation () const

Static Public Attributes

static NameServer
< EventType * > 
nameserver

Constructor & Destructor Documentation

Event ( const Event< SignatureT > &  m  )  [inline]

Event objects may be copied.

Parameters:
m the original

Definition at line 136 of file Event.hpp.

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 163 of file Event.hpp.


Member Function Documentation

Event& operator= ( const Event< SignatureT > &  m  )  [inline]

Event objects may be assigned.

Parameters:
m the original
Returns:
*this

Definition at line 148 of file Event.hpp.

Event& 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 180 of file Event.hpp.

bool ready (  )  const [inline]

Check if this Event is ready for execution.

Returns:
true if so.

Definition at line 196 of file Event.hpp.

Handle connect ( const SlotFunction f  )  [inline]

Connect a synchronous event slot to this event.

Definition at line 213 of file Event.hpp.

Handle connect ( const SlotFunction l,
EventProcessor ep,
AsynStorageType  t = EventProcessor::OnlyFirst 
) [inline]

Connect an Asynchronous event slot to this event.

Definition at line 221 of file Event.hpp.

Handle setup ( const SlotFunction f  )  [inline]

Setup a synchronous event slot to this event.

Definition at line 229 of file Event.hpp.

Handle setup ( const SlotFunction l,
EventProcessor ep,
AsynStorageType  t = EventProcessor::OnlyFirst 
) [inline]

Setup an Asynchronous event slot to this event.

Definition at line 237 of file Event.hpp.


Member Data Documentation

NameServer< Event< SignatureT > * > nameserver [inline, static]

Public nameserver for Events.

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

Definition at line 249 of file Event.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Mar 25 17:41:56 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3