CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
23 #include <boost/asio.hpp>
25 namespace catapult {
namespace thread {
28 template<
typename TOwner>
37 template<
typename THandler>
38 auto wrap(
const std::shared_ptr<TOwner>& pOwner, THandler handler) {
41 return m_strand.wrap(wrappedHandler);
46 template<
typename THandler>
47 void post(
const std::shared_ptr<TOwner>& pOwner, THandler handler) {
49 boost::asio::post(
m_strand, [pOwner, handler]() {
Wraps a strand and automatically augments handlers to extend the lifetime of an owning object.
Definition: StrandOwnerLifetimeExtender.h:29
void post(const std::shared_ptr< TOwner > &pOwner, THandler handler)
Attaches pOwner to handler and posts it to the strand.
Definition: StrandOwnerLifetimeExtender.h:47
auto wrap(const std::shared_ptr< TOwner > &pOwner, THandler handler)
Wraps handler and attaches pOwner to it.
Definition: StrandOwnerLifetimeExtender.h:38
StrandOwnerLifetimeExtender(boost::asio::io_context::strand &strand)
Creates a strand owner lifetime extender around strand.
Definition: StrandOwnerLifetimeExtender.h:32
boost::asio::io_context::strand & m_strand
Definition: StrandOwnerLifetimeExtender.h:55
Definition: AddressExtractionExtension.cpp:28
Definition: WrappedWithOwnerDecorator.h:29