8 : m_token(token), m_pending_replies(std::move(ptr)) {
17 if (
auto pending = m_pending_replies.lock(); pending) {
18 pending->Release(m_token);
27 return !m_pending.empty();
31 std::vector<PendingReply> r;
32 r.reserve(m_pending.size());
33 std::transform(m_pending.begin(), m_pending.end(), std::back_inserter(r),
34 [](
auto const& tup) ->
PendingReply { return std::get<1>(tup); });
39 auto token = m_next_token_id++;
40 m_pending.emplace_back(std::tuple<uint64_t, PendingReply>(
41 {token,
PendingReply{std::move(source_id), std::move(request)}}));
46 std::string request) {
47 auto token = m_next_token_id++;
48 m_pending.emplace_back(std::tuple<uint64_t, PendingReply>(
49 {token,
PendingReply{std::move(source_id), std::move(request)}}));
50 return std::shared_ptr<ReplyToken>(
new ReplyToken(token, shared_from_this()));
55 std::remove_if(m_pending.begin(), m_pending.end(),
56 [=](
auto const& tup) ->
bool {
57 return std::get<0>(tup) == token; }),