8 #ifndef OCF_DAQ_PENDING_REPLIES_HPP_
9 #define OCF_DAQ_PENDING_REPLIES_HPP_
39 explicit ReplyToken(uint64_t token, std::weak_ptr<PendingReplies> pending_replies) noexcept;
43 std::weak_ptr<PendingReplies> m_pending_replies;
68 static std::shared_ptr<PendingReplies>
Create();
76 std::shared_ptr<ReplyToken>
AcquireShared(std::string source_id, std::string request);
86 uint64_t m_next_token_id = 1;
87 std::vector<std::tuple<uint64_t, PendingReply>> m_pending;
Simple class that allows you to keep track of how many replies are pending.
static std::shared_ptr< PendingReplies > Create()
Create instance.
void Release(uint64_t token)
ReplyToken Acquire(std::string source_id, std::string request)
Acquire token.
bool HasPendingReplies() const
std::shared_ptr< ReplyToken > AcquireShared(std::string source_id, std::string request)
std::vector< PendingReply > GetPendingReplies() const
Token representing a not-yet-received reply.
ReplyToken & operator=(ReplyToken &&)=default
void Release()
Release token explicitly.
ReplyToken(ReplyToken &&)=default