#include </home/sspr/src/www/orocos-1.0/export/build/orocos-rtt-1.2.2/build/rtt/CompletionProcessor.hpp>
Inheritance diagram for CompletionProcessor:

This is an utility class which can be used to execute Event callback functions in a thread. It's purpose is to allow a way to process not real-time event callback functions, without disturbing the emitor of the event. If the user requires a not real-time, complex or lengthy callback execution, it can be done in this activity.
Public Types | |
| typedef CompletionProcessor * | CompletionProcessorPtr |
| 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 | |
| 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 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. | |
| 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. | |
| ActivityInterface * | getActivity () const |
| Query for the task this interface is run in. | |
| virtual void | setActivity (ActivityInterface *task) |
| Set the task this interface is run in. | |
| virtual void | loop () |
| The method that will be executed once when this class is run in a non periodic thread. | |
| ThreadInterface * | getThread () const |
| Get the thread this object is run in. | |
| virtual void | setThread (ThreadInterface *t) |
| Set the thread this object will be run in. | |
| bool | run (RunnableInterface *r) |
| Run another (or self in case of null) task. | |
| bool | run (int) |
| Run another (or self in case of null) task. | |
| virtual Seconds | getPeriod () const |
| Get the periodicity of this activity in Seconds. | |
| virtual ThreadInterface * | thread () |
| Returns a pointer to the thread which will run this activity. | |
| virtual bool | initialize () |
| virtual void | loop () |
| virtual bool | breakLoop () |
| virtual void | finalize () |
| virtual bool | isPeriodic () const |
| Inspect if this activity is periodic. | |
| virtual bool | start () |
| Start the activity. | |
| virtual bool | execute () |
| Execute this activity such that it executes a step or loop of the RunnableInterface. | |
| virtual bool | trigger () |
| Trigger that work has to be done. | |
| virtual bool | stop () |
| Stop the activity This will stop the activity by removing it from the 'run-queue' of a thread or call RunnableInterface::breakLoop(). | |
| virtual bool | isRunning () const |
| Query if the activity is initialized and executing. | |
| virtual bool | isActive () const |
| Query if the activity is started. | |
Static Public Member Functions | |
| static CompletionProcessorPtr | Instance () |
| Returns the unique (singleton) CompletionProcessor. | |
| static bool | Release () |
| Releases the CompletionProcessor. | |
Protected Types | |
| typedef ListLockFree< detail::EventCatcher * > | List |
| The EC is released when the connection it is used in is deleted *and* it is removed from this vector. | |
Protected Member Functions | |
| CompletionProcessor () | |
| Constructor. | |
| void | destroyed (detail::EventCatcher *ec) |
Protected Attributes | |
| List | catchers |
Friends | |
| class | detail::EventCatcher |
enum AsynStorageType [inherited] |
| static bool Release | ( | ) | [static] |
| Handle 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.
| 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. |
| Handle 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().
| 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. |
| ActivityInterface * 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.
| virtual void setActivity | ( | ActivityInterface * | task | ) | [virtual, inherited] |
Set the task this interface is run in.
A Zero means no task is running it.
| task | The ActivityInterface running this interface. |
Reimplemented in ExecutionEngine.
| virtual void loop | ( | ) | [virtual, inherited] |
The method that will be executed once when this class is run in a non periodic thread.
The default implementation calls step() once.
| ThreadInterface* getThread | ( | ) | const [inherited] |
Get the thread this object is run in.
| bool run | ( | int | ) | [inline, inherited] |
Run another (or self in case of null) task.
This overload is needed to redirect the call of run( 0 ) to the correct function.
| virtual Seconds getPeriod | ( | ) | const [virtual, inherited] |
Get the periodicity of this activity in Seconds.
Implements ActivityInterface.
| virtual ThreadInterface* thread | ( | ) | [virtual, inherited] |
Returns a pointer to the thread which will run this activity.
Will not be null.
Implements ActivityInterface.
| virtual bool isPeriodic | ( | ) | const [virtual, inherited] |
Inspect if this activity is periodic.
If so, it will call RunnableInterface::step(). If the activity is not periodic, it will call RunnableInterface::loop().
Implements ActivityInterface.
| virtual bool start | ( | ) | [virtual, inherited] |
Start the activity.
This will call RunnableInterface::initialize() and upon success, effectively start the activity, by running the RunnableInterface::step() or RunnableInterface::loop() in a thread.
Implements ActivityInterface.
| virtual bool execute | ( | ) | [virtual, inherited] |
Execute this activity such that it executes a step or loop of the RunnableInterface.
When you invoke execute() you intend to call the step() or loop() methods. Some activity implementations allow a user controlled execute, others ignore it.
| true | When this->isActive() and the implementation allows external executes. | |
| false | When !this->isActive() or the implementation does not allow external updating. |
Implements ActivityInterface.
| virtual bool trigger | ( | ) | [virtual, inherited] |
Trigger that work has to be done.
When you invoke trigger(), you intend to notify the instance that calls execute(), that execute() should be called. This allows a separation between actually executing code (execute()) and notifying that code must be executed (trigger()). A trigger may be ignored by the implementation.
| true | When this->isActive() and the implementation allows external triggers. | |
| false | When !this->isActive() or the implementation does not allow external triggering. |
Implements ActivityInterface.
| virtual bool stop | ( | ) | [virtual, inherited] |
Stop the activity This will stop the activity by removing it from the 'run-queue' of a thread or call RunnableInterface::breakLoop().
If no errors occured, RunnableInterface::finalize() is called.
Implements ActivityInterface.
| virtual bool isRunning | ( | ) | const [virtual, inherited] |
Query if the activity is initialized and executing.
This is more strict than isActive(), it is only true after initialize() is executed and before finalize() is executed. More-over, an Activity may decide to be temporarily not running (not executing code), waiting for a signal to proceed. If this->isActive() and !this->isRunning() then the Activity is in a waiting state.
Implements ActivityInterface.
| virtual bool isActive | ( | ) | const [virtual, inherited] |
Query if the activity is started.
This is less strict than isRunning(), it is true during initialize(), step() or loop() and finalize(). Use this method to check if an activity was start()ed.
Implements ActivityInterface.
1.5.1