foobar2000 SDK
2015-08-03
|
#include <abort_callback.h>
Public Member Functions | |
void | check () const |
void | check_e () const |
virtual abort_callback_event | get_abort_event () const =0 |
abort_callback_event | get_handle () const |
virtual bool | is_aborting () const =0 |
bool | is_set () const |
void | sleep (double p_timeout_seconds) const |
bool | sleep_ex (double p_timeout_seconds) const |
bool | waitForEvent (pfc::eventHandle_t evtHandle, double timeOut) |
bool | waitForEvent (pfc::event &evt, double timeOut) |
Protected Member Functions | |
abort_callback () | |
~abort_callback () | |
This class is used to signal underlying worker code whether user has decided to abort a potentially time-consuming operation.
It is commonly required by all filesystem related or decoding-related operations.
Code that receives an abort_callback object should periodically check it and abort any operations being performed if it is signaled, typically throwing exception_aborted.
See abort_callback_impl for an implementation.
Definition at line 17 of file abort_callback.h.
|
inlineprotected |
Definition at line 46 of file abort_callback.h.
|
inlineprotected |
Definition at line 47 of file abort_callback.h.
void abort_callback::check | ( | ) | const |
Checks if user has requested the operation to be aborted, and throws exception_aborted if so.
Definition at line 3 of file abort_callback.cpp.
|
inline |
For compatibility with old code. Do not call.
Definition at line 35 of file abort_callback.h.
|
pure virtual |
Retrieves event object that can be used with some OS calls. The even object becomes signaled when abort is triggered. On win32, this is equivalent to win32 event handle (see: CreateEvent).
You must not close this handle or call any methods that change this handle's state (SetEvent() or ResetEvent()), you can only wait for it.
Implemented in foobar2000_io::abort_callback_dummy, and foobar2000_io::abort_callback_impl.
|
inline |
Definition at line 29 of file abort_callback.h.
|
pure virtual |
Returns whether user has requested the operation to be aborted.
Implemented in foobar2000_io::abort_callback_dummy, and foobar2000_io::abort_callback_impl.
|
inline |
Definition at line 23 of file abort_callback.h.
void abort_callback::sleep | ( | double | p_timeout_seconds | ) | const |
Sleeps p_timeout_seconds or less when aborted, throws exception_aborted on abort.
Definition at line 7 of file abort_callback.cpp.
bool abort_callback::sleep_ex | ( | double | p_timeout_seconds | ) | const |
Sleeps p_timeout_seconds or less when aborted, returns true when execution should continue, false when not.
Definition at line 11 of file abort_callback.cpp.
bool abort_callback::waitForEvent | ( | pfc::eventHandle_t | evtHandle, |
double | timeOut | ||
) |
Definition at line 16 of file abort_callback.cpp.
|
inline |
Definition at line 44 of file abort_callback.h.