Derecho  0.9
Distributed systems toolkit for RDMA
Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
derecho::rpc::QueryResults< Ret > Class Template Reference

Data structure that (indirectly) holds a set of futures for a single RPC function call; there is one future for each node contacted to make the call, and it will eventually contain that node's reply. More...

#include <rpc_utils.hpp>

Collaboration diagram for derecho::rpc::QueryResults< Ret >:
Collaboration graph
[legend]

Classes

class  ReplyMap
 

Public Types

using map_fut = std::future< std::unique_ptr< reply_map< Ret > >>
 
using map = reply_map< Ret >
 
using type = Ret
 

Public Member Functions

 QueryResults (map_fut pm)
 
 QueryResults (QueryResults &&o)
 
 QueryResults (const QueryResults &)=delete
 
template<typename Time >
ReplyMapwait (Time t)
 Wait the specified duration; if a ReplyMap is available after that duration, return it. More...
 
ReplyMapget ()
 Block until the ReplyMap is fulfilled, then return the map by reference. More...
 

Public Attributes

map_fut pending_rmap
 

Private Attributes

ReplyMap replies {*this}
 

Detailed Description

template<typename Ret>
class derecho::rpc::QueryResults< Ret >

Data structure that (indirectly) holds a set of futures for a single RPC function call; there is one future for each node contacted to make the call, and it will eventually contain that node's reply.

The futures are actually stored inside an internal struct of type ReplyMap, which can be retrieved with the get() method. The ReplyMap will not be returned until it is "fulfilled" by the sender, which should happen when the RPC call is delivered in the current View (and thus, the current View is the set of nodes who should reply to the RPC).

Template Parameters
RetThe return type of the RPC function that this query invoked

Definition at line 158 of file rpc_utils.hpp.

Member Typedef Documentation

◆ map

template<typename Ret>
using derecho::rpc::QueryResults< Ret >::map = reply_map<Ret>

Definition at line 161 of file rpc_utils.hpp.

◆ map_fut

template<typename Ret>
using derecho::rpc::QueryResults< Ret >::map_fut = std::future<std::unique_ptr<reply_map<Ret> >>

Definition at line 160 of file rpc_utils.hpp.

◆ type

template<typename Ret>
using derecho::rpc::QueryResults< Ret >::type = Ret

Definition at line 162 of file rpc_utils.hpp.

Constructor & Destructor Documentation

◆ QueryResults() [1/3]

template<typename Ret>
derecho::rpc::QueryResults< Ret >::QueryResults ( map_fut  pm)
inline

Definition at line 208 of file rpc_utils.hpp.

◆ QueryResults() [2/3]

template<typename Ret>
derecho::rpc::QueryResults< Ret >::QueryResults ( QueryResults< Ret > &&  o)
inline

Definition at line 209 of file rpc_utils.hpp.

◆ QueryResults() [3/3]

template<typename Ret>
derecho::rpc::QueryResults< Ret >::QueryResults ( const QueryResults< Ret > &  )
delete

Member Function Documentation

◆ get()

template<typename Ret>
ReplyMap& derecho::rpc::QueryResults< Ret >::get ( )
inline

Block until the ReplyMap is fulfilled, then return the map by reference.

The ReplyMap is only valid as long as this QueryResults remains in scope, and cannot be copied.

Definition at line 235 of file rpc_utils.hpp.

◆ wait()

template<typename Ret>
template<typename Time >
ReplyMap* derecho::rpc::QueryResults< Ret >::wait ( Time  t)
inline

Wait the specified duration; if a ReplyMap is available after that duration, return it.

Otherwise return nullptr.

Definition at line 219 of file rpc_utils.hpp.

Member Data Documentation

◆ pending_rmap

template<typename Ret>
map_fut derecho::rpc::QueryResults< Ret >::pending_rmap

Definition at line 202 of file rpc_utils.hpp.

◆ replies

template<typename Ret>
ReplyMap derecho::rpc::QueryResults< Ret >::replies {*this}
private

Definition at line 205 of file rpc_utils.hpp.


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