ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
daq::PendingReplies Class Reference

Simple class that allows you to keep track of how many replies are pending. More...

#include <pendingReplies.hpp>

+ Inheritance diagram for daq::PendingReplies:

Classes

struct  PendingReply
 

Public Member Functions

ReplyToken Acquire (std::string source_id, std::string request)
 Acquire token. More...
 
std::shared_ptr< ReplyTokenAcquireShared (std::string source_id, std::string request)
 
bool HasPendingReplies () const
 
std::vector< PendingReplyGetPendingReplies () const
 

Static Public Member Functions

static std::shared_ptr< PendingRepliesCreate ()
 Create instance. More...
 

Protected Member Functions

void Release (uint64_t token)
 
 PendingReplies ()=default
 

Protected Attributes

friend ReplyToken
 

Detailed Description

Simple class that allows you to keep track of how many replies are pending.

Usage:

For each request acquire a token with acquire. The token is movable but not copyable to guarantee uniqueness.

Once reply is released release the token by deleting it.

Definition at line 58 of file pendingReplies.hpp.


Class Documentation

◆ daq::PendingReplies::PendingReply

struct daq::PendingReplies::PendingReply

Definition at line 60 of file pendingReplies.hpp.

Class Members
string request
string source_id

Constructor & Destructor Documentation

◆ PendingReplies()

daq::PendingReplies::PendingReplies ( )
protecteddefault

Member Function Documentation

◆ Acquire()

ReplyToken daq::PendingReplies::Acquire ( std::string  source_id,
std::string  request 
)

Acquire token.

Keep the token alive until reply is received, then delete it.

Definition at line 38 of file pendingReplies.cpp.

◆ AcquireShared()

std::shared_ptr< ReplyToken > daq::PendingReplies::AcquireShared ( std::string  source_id,
std::string  request 
)

Definition at line 45 of file pendingReplies.cpp.

◆ Create()

std::shared_ptr< PendingReplies > daq::PendingReplies::Create ( )
static

Create instance.

Definition at line 22 of file pendingReplies.cpp.

◆ GetPendingReplies()

std::vector< PendingReplies::PendingReply > daq::PendingReplies::GetPendingReplies ( ) const

Definition at line 30 of file pendingReplies.cpp.

◆ HasPendingReplies()

bool daq::PendingReplies::HasPendingReplies ( ) const

Definition at line 26 of file pendingReplies.cpp.

◆ Release()

void daq::PendingReplies::Release ( uint64_t  token)
protected

Definition at line 53 of file pendingReplies.cpp.

Member Data Documentation

◆ ReplyToken

friend daq::PendingReplies::ReplyToken
protected

Definition at line 82 of file pendingReplies.hpp.


The documentation for this class was generated from the following files: