FDR
4.2.7(6ecbe5a21b71ab020e8fcaeccfe5ebaad0599f4f)
|
Allows cancellation of a running task to be requested. More...
#include <canceller.h>
Public Member Functions | |
Canceller () | |
Creates a new canceller. | |
Canceller (const Canceller &)=delete | |
void | cancel () |
Mark this canceller as cancelled. More... | |
bool | cancelled () const |
Returns true if this canceller has been cancelled. | |
Canceller & | operator= (const Canceller &)=delete |
Friends | |
struct | CancellerHelper |
Allows cancellation of a running task to be requested.
Many of the tasks in FDR, such as checking a refinement assertion can be long-running, and thus may need to be cancelled before their natural completion. Cancellers allow this by supplying a cancel() method that requests cancellation of a certain task, which will endeavour to return as soon as it is safe to do so.
For example, a refinement assertion may be cancelled by using code similar to the following:
If you do not wish to allow for cancellation, then nullptr can always be passed to any function in place of a Canceller.
void FDR::Canceller::cancel | ( | ) |
Mark this canceller as cancelled.
This is NOT safe to call from a signal handler.