RTT::BlockingEventProcessor Class Reference

The Blocking EventProcessor, extended with a blocking implementation, waiting for one Event to complete in its loop(). More...

#include <rtt/EventProcessor.hpp>

Inheritance diagram for RTT::BlockingEventProcessor:
RTT::EventProcessor RTT::RunnableInterface RTT::OS::RunnableInterface RTT::CompletionProcessor

List of all members.

Public Types

enum  AsynStorageType { OnlyFirst, OnlyLast }
 

For Asynchronous callbacks, this enum defines how the arguments are stored in case of an overrun, ie, when the event is fired multiple times, before the asynchronous callback can be called.

More...

Public Member Functions

 BlockingEventProcessor ()
 Create a blocking (non periodic) EventProcessor, which will trigger() the activity if an event needs processing.
bool initialize ()
 The method that will be called before the first periodical execution of step() ( or non periodical execution of loop() ), when the thread is started.
void step ()
 The method that will be periodically executed when this class RTT_API is run in a periodic thread.
void finalize ()
 The method that will be called after the last periodical execution of step() ( or non periodical execution of loop() ), when the RunnableInterface is stopped.
bool breakLoop ()
 Force the loop() method to return.
bool hasWork ()
 This method is for 'intelligent' activity implementations that wish to see if it is required to call step() (again).
template<class SignalType >
Handle connect (const typename SignalType::SlotFunction &f, SignalType &sig, AsynStorageType t)
 Connect a function to an Event and process upon each event the function in this event processor.
template<class SignalType >
Handle setup (const typename SignalType::SlotFunction &f, SignalType &sig, AsynStorageType t)
 Setup the processing of an asynchronous event.
ActivityInterfacegetActivity () const
 Query for the task this interface is run in.
virtual void setActivity (ActivityInterface *task)
 Set the task this interface is run in.
virtual OS::ThreadInterfacegetThread () const
 Get the thread this object is run in.
virtual void loop ()
 The method that will be executed once when this class RTT_API is run in a non periodic thread.
virtual void setThread (ThreadInterface *t)
 Set the thread this object will be run in.

Protected Types

typedef List
< detail::EventCatcher * > 
ECList
 The EC is released when the connection it is used in is deleted *and* it is removed from this vector.

Protected Member Functions

void destroyed (detail::EventCatcher *ec)

Protected Attributes

ECList catchers
OS::AtomicInt has_work

Friends

struct EventCatcher
struct detail::EventCatcher

Detailed Description

The Blocking EventProcessor, extended with a blocking implementation, waiting for one Event to complete in its loop().

Definition at line 624 of file EventProcessor.hpp.


Member Enumeration Documentation

For Asynchronous callbacks, this enum defines how the arguments are stored in case of an overrun, ie, when the event is fired multiple times, before the asynchronous callback can be called.

Enumerator:
OnlyLast 

< Only call the callback once with the first fire() call's arguments

< Only call the callback once with the last fire() call's arguments

Definition at line 533 of file EventProcessor.hpp.


Member Function Documentation

template<class SignalType >
Handle RTT::EventProcessor::connect ( const typename SignalType::SlotFunction &  f,
SignalType &  sig,
AsynStorageType  t 
) [inline, inherited]

Connect a function to an Event and process upon each event the function in this event processor.

The returned handle holds the connection between f and sig.

Parameters:
f will be called within this EventProcessor when sig is emitted.
sig The Event to which f will react.
t specifies the policy in case of over-runs. That is, when sig is emitted multiple times before f could be called.
Returns:
An connected handle. Call Handle::disconnect() upon this object in order to remove the link between f and sig.

Definition at line 569 of file EventProcessor.hpp.

References RTT::Handle::connect().

Referenced by RTT::Event< void() >::connect().

ActivityInterface * RTT::RunnableInterface::getActivity (  )  const [inline, inherited]

Query for the task this interface is run in.

Zero denotes that no task is present to run it, and hence no detailed information is available.

Returns:
The Activity which runs this RunnableInterface.

Definition at line 106 of file RunnableInterface.hpp.

virtual OS::ThreadInterface* RTT::RunnableInterface::getThread (  )  const [virtual, inherited]

Get the thread this object is run in.

Returns:
a pointer to the thread or 0 if not run by a thread.

Reimplemented from RTT::OS::RunnableInterface.

bool RTT::EventProcessor::hasWork (  )  [virtual, inherited]

This method is for 'intelligent' activity implementations that wish to see if it is required to call step() (again).

By default, false is returned. You should only return true in case there is a temporary reason to (re-)run step.

Returns:
true if this object should be run.
See also:
SequentialActivity implementation to see how this can be of use.

Reimplemented from RTT::RunnableInterface.

virtual void RTT::OS::RunnableInterface::loop (  )  [virtual, inherited]

The method that will be executed once when this class RTT_API is run in a non periodic thread.

The default implementation calls step() once.

Reimplemented in RTT::Timer.

virtual void RTT::RunnableInterface::setActivity ( ActivityInterface task  )  [virtual, inherited]

Set the task this interface is run in.

A Zero means no task is running it.

Parameters:
task The ActivityInterface running this interface.

Reimplemented in RTT::ExecutionEngine.

template<class SignalType >
Handle RTT::EventProcessor::setup ( const typename SignalType::SlotFunction &  f,
SignalType &  sig,
AsynStorageType  t 
) [inline, inherited]

Setup the processing of an asynchronous event.

The returned handle does not yet connect f and sig. Use Handle::connect().

Parameters:
f will be called within this EventProcessor when sig is emitted.
sig The Event to which f will react.
t specifies the policy in case of over-runs. That is, when sig is emitted multiple times before f could be called.
Returns:
An unconnected handle. Call Handle::connect() upon this object in order to activate the link between f and sig.

Definition at line 587 of file EventProcessor.hpp.

Referenced by RTT::Event< void() >::setup().


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