1 #ifndef _foobar2000_sdk_abort_callback_h_ 2 #define _foobar2000_sdk_abort_callback_h_ 21 virtual bool is_aborting()
const = 0;
23 inline bool is_set()
const {
return is_aborting();}
27 virtual abort_callback_event get_abort_event()
const = 0;
29 inline abort_callback_event
get_handle()
const {
return get_abort_event();}
39 void sleep(
double p_timeout_seconds)
const;
41 bool sleep_ex(
double p_timeout_seconds)
const;
56 inline void abort() {set_state(
true);}
57 inline void set() {set_state(
true);}
58 inline void reset() {set_state(
false);}
60 void set_state(
bool p_state) {m_aborting = p_state; m_event.set_state(p_state);}
98 #define FB2K_PFCv2_ABORTER_SCOPE( abortObj ) \ 100 PP::waitableReadRef_t aborterRef = {(abortObj).get_abort_event()}; \ 101 PP::aborter aborter_pfcv2( aborterRef ); \ 102 PP::aborterScope l_aborterScope( aborter_pfcv2 ); 104 #endif //_foobar2000_sdk_abort_callback_h_
void set_state(bool p_state)
This class is used to signal underlying worker code whether user has decided to abort a potentially t...
foobar2000_io::abort_callback fb2k_event
foobar2000_io::abort_callback_impl fb2k_event_impl
bool waitForEvent(pfc::event &evt, double timeOut)
pfc::eventHandle_t abort_callback_event
Implementation of abort_callback interface.
abort_callback_impl abort_callback_dummy
PFC_DECLARE_EXCEPTION(exception_aborted, pfc::exception,"User abort")
bool is_aborting() const
Returns whether user has requested the operation to be aborted.
Contains various I/O related structures and interfaces.
HANDLE get_handle() const
Dummy abort_callback that never gets aborted. Slightly more efficient than the regular one especiall...
abort_callback_event get_handle() const
foobar2000_io::abort_callback_event fb2k_event_handle
void check_e() const
For compatibility with old code. Do not call.
HANDLE SHARED_EXPORT GetInfiniteWaitEvent()
bool is_aborting() const
Returns whether user has requested the operation to be aborted.
abort_callback_event get_abort_event() const
Retrieves event object that can be used with some OS calls. The even object becomes signaled when abo...
abort_callback_event get_abort_event() const
Retrieves event object that can be used with some OS calls. The even object becomes signaled when abo...