| helics 3.6.1

Public Member Functions | List of all members
helics::zeromq::ZmqRequestSets Class Reference

`#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 ()

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ ZmqRequestSets()

helics::zeromq::ZmqRequestSets::ZmqRequestSets | ( |  | ) |

constructor

## Member Function Documentation

## ◆ addRoutes()

void helics::zeromq::ZmqRequestSets::addRoutes | ( | int | routeNumber,
|  | const std::string & | routeInfo
| ) |  |

add a route to the request set

## ◆ checkForMessages() [1/2]

int helics::zeromq::ZmqRequestSets::checkForMessages | ( |  | ) |

check for messages with a 0 second timeout

Returns
  the number of message waiting to be received

## ◆ checkForMessages() [2/2]

int helics::zeromq::ZmqRequestSets::checkForMessages | ( | std::chrono::milliseconds | timeout | ) |

check for messages with an explicit timeout

Returns
  the number of message waiting to be received

## ◆ close()

void helics::zeromq::ZmqRequestSets::close | ( |  | ) |

close all the sockets

## ◆ getMessage()

std::optional< ActionMessage > helics::zeromq::ZmqRequestSets::getMessage | ( |  | ) |

get any messages that have been received

## ◆ hasMessages()

bool helics::zeromq::ZmqRequestSets::hasMessages | ( |  | ) | const

check if there are any waiting message without scanning the sockets

## ◆ transmit()

bool helics::zeromq::ZmqRequestSets::transmit | ( | int | routeNumber,
|  | const ActionMessage & | command
| ) |  |

transmit a command to a specific route number

References helics::ActionMessage::to_string().

## ◆ waiting()

bool helics::zeromq::ZmqRequestSets::waiting | ( |  | ) | const

check if the request set is waiting on any on responses

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

- ZmqRequestSets.h
- ZmqRequestSets.cpp