/usr/include/boost/beast/core
NameSizeModeActions
detail/-0755rm
impl/-0755rm
async_base.hpp264610644editdlrm
basic_stream.hpp553420644editdlrm
bind_handler.hpp41720644editdlrm
buffered_read_stream.hpp118770644editdlrm
buffers_adaptor.hpp67830644editdlrm
buffers_cat.hpp33830644editdlrm
buffers_prefix.hpp61520644editdlrm
buffers_range.hpp42110644editdlrm
buffers_suffix.hpp39710644editdlrm
buffers_to_string.hpp17700644editdlrm
buffer_traits.hpp57570644editdlrm
detect_ssl.hpp223450644editdlrm
error.hpp22570644editdlrm
file.hpp10280644editdlrm
file_base.hpp50150644editdlrm
file_posix.hpp42220644editdlrm
file_stdio.hpp38490644editdlrm
file_win32.hpp42480644editdlrm
flat_buffer.hpp154270644editdlrm
flat_static_buffer.hpp87060644editdlrm
flat_stream.hpp126030644editdlrm
make_printable.hpp28030644editdlrm
multi_buffer.hpp181530644editdlrm
ostream.hpp26900644editdlrm
rate_policy.hpp45920644editdlrm
read_size.hpp18440644editdlrm
role.hpp13220644editdlrm
saved_handler.hpp37880644editdlrm
span.hpp47870644editdlrm
static_buffer.hpp85150644editdlrm
static_string.hpp257200644editdlrm
stream_traits.hpp163990644editdlrm
string.hpp19410644editdlrm
string_param.hpp34590644editdlrm
string_type.hpp10920644editdlrm
tcp_stream.hpp8530644editdlrm
Edit: /usr/include/boost/beast/core/saved_handler.hpp (3788B)
// // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/boostorg/beast // #ifndef BOOST_BEAST_CORE_SAVED_HANDLER_HPP #define BOOST_BEAST_CORE_SAVED_HANDLER_HPP #include namespace boost { namespace beast { /** An invocable, nullary function object which holds a completion handler. This container can hold a type-erased instance of any completion handler, or it can be empty. When the container holds a value, the implementation maintains an instance of `net::executor_work_guard` for the handler's associated executor. Memory is dynamically allocated to store the completion handler, and the allocator may optionally be specified. Otherwise, the implementation uses the handler's associated allocator. */ class saved_handler { class base; template class impl; base* p_ = nullptr; public: /// Default Constructor saved_handler() = default; /// Copy Constructor (deleted) saved_handler(saved_handler const&) = delete; /// Copy Assignment (deleted) saved_handler& operator=(saved_handler const&) = delete; /// Destructor BOOST_BEAST_DECL ~saved_handler(); /// Move Constructor BOOST_BEAST_DECL saved_handler(saved_handler&& other) noexcept; /// Move Assignment BOOST_BEAST_DECL saved_handler& operator=(saved_handler&& other) noexcept; /// Returns `true` if `*this` contains a completion handler. bool has_value() const noexcept { return p_ != nullptr; } /** Store a completion handler in the container. Requires `this->has_value() == false`. @param handler The completion handler to store. The implementation takes ownership of the handler by performing a decay-copy. @param alloc The allocator to use. */ template void emplace(Handler&& handler, Allocator const& alloc); /** Store a completion handler in the container. Requires `this->has_value() == false`. The implementation will use the handler's associated allocator to obtian storage. @param handler The completion handler to store. The implementation takes ownership of the handler by performing a decay-copy. */ template void emplace(Handler&& handler); /** Discard the saved handler, if one exists. If `*this` contains an object, it is destroyed. @returns `true` if an object was destroyed. */ BOOST_BEAST_DECL bool reset() noexcept; /** Unconditionally invoke the stored completion handler. Requires `this->has_value() == true`. Any dynamic memory used is deallocated before the stored completion handler is invoked. The executor work guard is also reset before the invocation. */ BOOST_BEAST_DECL void invoke(); /** Conditionally invoke the stored completion handler. Invokes the stored completion handler if `this->has_value() == true`, otherwise does nothing. Any dynamic memory used is deallocated before the stored completion handler is invoked. The executor work guard is also reset before the invocation. @return `true` if the invocation took place. */ BOOST_BEAST_DECL bool maybe_invoke(); }; } // beast } // boost #include #ifdef BOOST_BEAST_HEADER_ONLY #include #endif #endif