helics
3.5.2
|
#include <ZmqRequestSets.h>
Public Member Functions | |
ZmqRequestSets () | |
void | addRoutes (int routeNumber, const std::string &routeInfo) |
bool | transmit (int routeNumber, const ActionMessage &command) |
bool | waiting () const |
int | checkForMessages () |
int | checkForMessages (std::chrono::milliseconds timeout) |
bool | hasMessages () const |
std::optional< ActionMessage > | getMessage () |
void | close () |
class for dealing with the priority message paths from a ZMQ comm object
it manages a set of routes to different priority queues and handles the responses THIS CLASS IS NOT THREAD SAFE- ZMQ sockets cannot be transferred between threads without special care so it would be VERY problematic to use this where multiple threads will interact with it, thus no reason to make it thread safe
helics::zeromq::ZmqRequestSets::ZmqRequestSets | ( | ) |
constructor
void helics::zeromq::ZmqRequestSets::addRoutes | ( | int | routeNumber, |
const std::string & | routeInfo | ||
) |
add a route to the request set
int helics::zeromq::ZmqRequestSets::checkForMessages | ( | ) |
check for messages with a 0 second timeout
int helics::zeromq::ZmqRequestSets::checkForMessages | ( | std::chrono::milliseconds | timeout | ) |
check for messages with an explicit timeout
void helics::zeromq::ZmqRequestSets::close | ( | ) |
close all the sockets
std::optional< ActionMessage > helics::zeromq::ZmqRequestSets::getMessage | ( | ) |
get any messages that have been received
bool helics::zeromq::ZmqRequestSets::hasMessages | ( | ) | const |
check if there are any waiting message without scanning the sockets
bool helics::zeromq::ZmqRequestSets::transmit | ( | int | routeNumber, |
const ActionMessage & | command | ||
) |
transmit a command to a specific route number
References helics::ActionMessage::to_string().
bool helics::zeromq::ZmqRequestSets::waiting | ( | ) | const |
check if the request set is waiting on any on responses