Cancels an operation automatically upon destruction. More...
#include <cancel-handle.hpp>
Public Member Functions | |
ScopedCancelHandle () noexcept=default | |
ScopedCancelHandle (CancelHandle hdl) | |
Implicit constructor from CancelHandle. More... | |
ScopedCancelHandle (const ScopedCancelHandle &)=delete | |
Copy construction is disallowed. More... | |
ScopedCancelHandle (ScopedCancelHandle &&other) | |
Move constructor. More... | |
ScopedCancelHandle & | operator= (const ScopedCancelHandle &)=delete |
Copy assignment is disallowed. More... | |
ScopedCancelHandle & | operator= (ScopedCancelHandle &&other) |
Move assignment operator. More... | |
~ScopedCancelHandle () | |
Cancel the operation. More... | |
void | cancel () |
Cancel the operation. More... | |
CancelHandle | release () |
Release the operation so that it won't be cancelled when this ScopedCancelHandle is destructed. More... | |
Cancels an operation automatically upon destruction.
Definition at line 51 of file cancel-handle.hpp.
|
defaultnoexcept |
ndn::detail::ScopedCancelHandle::ScopedCancelHandle | ( | CancelHandle | hdl | ) |
Implicit constructor from CancelHandle.
Definition at line 41 of file cancel-handle.cpp.
|
delete |
Copy construction is disallowed.
ndn::detail::ScopedCancelHandle::ScopedCancelHandle | ( | ScopedCancelHandle && | other | ) |
Move constructor.
Definition at line 46 of file cancel-handle.cpp.
ndn::detail::ScopedCancelHandle::~ScopedCancelHandle | ( | ) |
Cancel the operation.
Definition at line 59 of file cancel-handle.cpp.
References ndn::detail::CancelHandle::cancel().
|
delete |
Copy assignment is disallowed.
ScopedCancelHandle & ndn::detail::ScopedCancelHandle::operator= | ( | ScopedCancelHandle && | other | ) |
void ndn::detail::ScopedCancelHandle::cancel | ( | ) |
Cancel the operation.
Definition at line 65 of file cancel-handle.cpp.
References ndn::detail::CancelHandle::cancel(), and release().
Referenced by nfd::face::UnicastUdpTransport::afterChangePersistency(), nfd::face::UnicastEthernetTransport::afterChangePersistency(), nfd::face::TcpTransport::doClose(), nfd::face::WebSocketTransport::doClose(), operator=(), and ndn::InMemoryStorageEntry::release().
CancelHandle ndn::detail::ScopedCancelHandle::release | ( | ) |
Release the operation so that it won't be cancelled when this ScopedCancelHandle is destructed.
Definition at line 71 of file cancel-handle.cpp.
References nonstd::any_lite::swap().
Referenced by cancel().