|
Robot Raconteur Companion C++ Library
|
Base class for asynchronous task generators. More...
#include <TaskGenerator.h>
Public Member Functions | |
| AsyncTaskGenerator (const boost::shared_ptr< RobotRaconteur::RobotRaconteurNode > &node, int32_t next_timeout, int32_t watchdog_timeout) | |
| Represents an asynchronous task generator. | |
Protected Member Functions | |
| virtual void | SetResult (boost::intrusive_ptr< StatusType > &result) |
| Set the result of the generator. | |
| virtual void | SetResultException (boost::shared_ptr< RobotRaconteur::RobotRaconteurException > &exp) |
| Set the exception result of the generator. | |
| void | SendUpdate () |
| Send an update to the caller. | |
| virtual void | StartTask ()=0 |
| Start the task. | |
| virtual void | CloseRequested () |
| This method is called when a close request is received. | |
| virtual void | AbortRequested () |
| This method is called when an abort request is received. | |
| virtual void | FillStatus (boost::intrusive_ptr< StatusType > &status) |
| This method is called to fill the next status report. | |
Base class for asynchronous task generators.
Base class for asynchronous task generators. This utility class is used to help implement generators that represent long running operations.
Subclasses should override the following functions:
The operation should call SetResult() or SetResultException() when the operation is complete. The generator will then return the result to the caller.
| StatusType | The status type for the generator |
|
inline |
Represents an asynchronous task generator.
The AsyncTaskGenerator class is used to generate asynchronous tasks in RobotRaconteurCompanion. It takes a RobotRaconteurNode, next_timeout, and watchdog_timeout as parameters.
| node | The RobotRaconteurNode instance. |
| next_timeout | The timeout to return from the Next() function. |
| watchdog_timeout | The timeout for the watchdog. -1 to disable. |
|
inlineprotectedvirtual |
This method is called to fill the next status report.
This method is called to fill the next status report. Subclasses should override this method to fill the next status report.
| status | The status report to fill |
|
inlineprotected |
Send an update to the caller.
This method triggers Next() to return an intermediate status report. Override FillStatus() to fill the status report.
|
inlineprotectedvirtual |
Set the result of the generator.
This method sets the result of the generator. The generator will return the result to the caller.
| result | The result to return |
|
inlineprotectedvirtual |
Set the exception result of the generator.
This method sets the exception result of the generator. The generator will return the exception to the caller.
| exp | The exception to return |
|
protectedpure virtual |
Start the task.
This method is called when the generator is started. Subclasses should override this method to start the task.
Implemented in RobotRaconteur::Companion::Util::SyncTaskGenerator< StatusType >.