MCPcopy Create free account
hub / github.com/boostorg/asio / impl_0_completion_args

Class impl_0_completion_args

test/composed.cpp:29–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27//------------------------------------------------------------------------------
28
29class impl_0_completion_args
30{
31public:
32 explicit impl_0_completion_args(boost::asio::io_context& ioc)
33 : ioc_(ioc),
34 state_(starting)
35 {
36 }
37
38 template <typename Self>
39 void operator()(Self& self)
40 {
41 switch (state_)
42 {
43 case starting:
44 state_ = posting;
45 boost::asio::post(ioc_, static_cast<Self&&>(self));
46 break;
47 case posting:
48 self.complete();
49 break;
50 default:
51 break;
52 }
53 }
54
55private:
56 boost::asio::io_context& ioc_;
57 enum { starting, posting } state_;
58};
59
60template <typename CompletionToken>
61BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void())

Callers 1

async_0_completion_argsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected