.. index:: pair: class; EE::CancellationRegistration .. _doxid-class_e_e_1_1_cancellation_registration: class EE::CancellationRegistration ================================== .. toctree:: :hidden: Overview ~~~~~~~~ RAII handle for a callback registered on a :ref:`CancellationToken `. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class CancellationRegistration { public: // construction :target:`CancellationRegistration`(); :target:`CancellationRegistration`(CancellationRegistration&& other); :target:`CancellationRegistration`(const CancellationRegistration&); :target:`~CancellationRegistration`(); // methods CancellationRegistration& :target:`operator=`(CancellationRegistration&& other); CancellationRegistration& :target:`operator=`(const CancellationRegistration&); void :ref:`reset`(); :ref:`operator bool`() const; }; .. _details-class_e_e_1_1_cancellation_registration: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ RAII handle for a callback registered on a :ref:`CancellationToken `. Destroying (or :ref:`reset() ` -ing) the registration unregisters the callback if it has not fired. If the callback is running concurrently on the cancelling thread, destruction waits for it to finish, so state captured by the callback may be released right after the registration dies. A callback may destroy its own registration without deadlocking. Methods ------- .. index:: pair: function; reset .. _doxid-class_e_e_1_1_cancellation_registration_1ab1d93c6432ef1d9bb96afb70d53e75ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block void reset() Unregisters the callback now. .. index:: pair: function; operator bool .. _doxid-class_e_e_1_1_cancellation_registration_1aa72ac300e3614bc17c9b42ace38e8498: .. ref-code-block:: cpp :class: doxyrest-title-code-block operator bool() const .. rubric:: Returns: True while the callback is registered and has not been invoked.