CatapultServer
v0.5.0.1 (Elephant)
|
Wraps a strand and automatically augments handlers to extend the lifetime of an owning object. More...
Public Member Functions | |
StrandOwnerLifetimeExtender (boost::asio::io_context::strand &strand) | |
Creates a strand owner lifetime extender around strand. More... | |
template<typename THandler > | |
auto | wrap (const std::shared_ptr< TOwner > &pOwner, THandler handler) |
Wraps handler and attaches pOwner to it. More... | |
template<typename THandler > | |
void | post (const std::shared_ptr< TOwner > &pOwner, THandler handler) |
Attaches pOwner to handler and posts it to the strand. More... | |
Private Attributes | |
boost::asio::io_context::strand & | m_strand |
Wraps a strand and automatically augments handlers to extend the lifetime of an owning object.
|
inlineexplicit |
Creates a strand owner lifetime extender around strand.
|
inline |
Attaches pOwner to handler and posts it to the strand.
|
inline |
Wraps handler and attaches pOwner to it.
|
private |