helics
3.5.1
|
#include <ZmqComms.h>
Public Member Functions | |
ZmqComms () noexcept | |
~ZmqComms () | |
virtual void | loadNetworkInfo (const NetworkBrokerData &netInfo) override |
std::string | getPushAddress () const |
Public Member Functions inherited from helics::NetworkCommsInterface | |
NetworkCommsInterface (gmlc::networking::InterfaceTypes type, CommsInterface::thread_generation threads=CommsInterface::thread_generation::dual) noexcept | |
void | setBrokerPort (int brokerPortNumber) |
void | setPortNumber (int localPortNumber) |
int | getPortNumber () const |
void | setAutomaticPortStartPort (int startingPort) |
virtual void | setFlag (std::string_view flag, bool val) override |
int | findOpenPort (int count, std::string_view host) |
ActionMessage | generateReplyToIncomingMessage (ActionMessage &cmd) |
int | getPort () const |
std::string | getAddress () const |
Public Member Functions inherited from helics::CommsInterface | |
CommsInterface ()=default | |
CommsInterface (thread_generation threads) | |
virtual | ~CommsInterface () |
void | loadTargetInfo (std::string_view localTarget, std::string_view brokerTarget, gmlc::networking::InterfaceNetworks targetNetwork=gmlc::networking::InterfaceNetworks::LOCAL) |
void | transmit (route_id rid, const ActionMessage &cmd) |
void | transmit (route_id rid, ActionMessage &&cmd) |
void | addRoute (route_id rid, std::string_view routeInfo) |
void | removeRoute (route_id rid) |
bool | connect () |
void | disconnect () |
bool | reconnect () |
void | setName (const std::string &commName) |
void | setRequireBrokerConnection (bool requireBrokerConnection) |
void | setCallback (std::function< void(ActionMessage &&)> callback) |
void | setLoggingCallback (std::function< void(int level, std::string_view name, std::string_view message)> callback) |
void | setMessageSize (int maxMsgSize, int maxCount) |
bool | isConnected () const |
void | setTimeout (std::chrono::milliseconds timeOut) |
void | setServerMode (bool serverActive) |
void | logWarning (std::string_view message) const |
void | logError (std::string_view message) const |
void | logMessage (std::string_view message) const |
Additional Inherited Members | |
Public Types inherited from helics::CommsInterface | |
enum class | thread_generation { single , dual } |
Protected Types inherited from helics::CommsInterface | |
enum class | ConnectionStatus : int { STARTUP = -1 , CONNECTED = 0 , RECONNECTING = 1 , TERMINATED = 2 , ERRORED = 4 } |
Protected Member Functions inherited from helics::NetworkCommsInterface | |
ActionMessage | generatePortRequest (int cnt=1) const |
void | loadPortDefinitions (const ActionMessage &cmd) |
Protected Member Functions inherited from helics::CommsInterface | |
void | setTxStatus (ConnectionStatus status) |
void | setRxStatus (ConnectionStatus status) |
ConnectionStatus | getRxStatus () const |
ConnectionStatus | getTxStatus () const |
bool | propertyLock () |
void | propertyUnLock () |
void | join_tx_rx_thread () |
const std::string & | getRandomID () const |
Protected Attributes inherited from helics::NetworkCommsInterface | |
int | brokerPort {-1} |
standardized broker port to use for connection to the brokers | |
std::atomic< int > | PortNumber {-1} |
port to use for the local connection | |
bool | autoPortNumber {true} |
use an automatic port numbering based on broker responses | |
bool | useOsPortAllocation {false} |
use the operating system to allocate a port number | |
bool | appendNameToAddress {false} |
flag to append the name to the network address | |
bool | noAckConnection {false} |
flag to bypass the connection acknowledge requirement | |
bool | encrypted {false} |
bool | forceConnection {false} |
const gmlc::networking::InterfaceTypes | networkType |
gmlc::networking::InterfaceNetworks | network {gmlc::networking::InterfaceNetworks::IPV4} |
std::atomic< bool > | hasBroker {false} |
int | maxRetries {5} |
Protected Attributes inherited from helics::CommsInterface | |
gmlc::concurrency::TriggerVariable | rxTrigger |
std::string | name |
the name of the object | |
std::string | localTargetAddress |
the base for the receive address | |
std::string | brokerTargetAddress |
the base for the broker address | |
std::string | brokerName |
std::string | brokerInitString |
the initialization string for any automatically generated broker | |
bool | mRequireBrokerConnection |
specify that the comms should assume we have a broker More... | |
bool | serverMode {true} |
some comms have a server mode and non-server mode | |
bool | autoBroker {false} |
the broker should be automatically generated if needed | |
bool | useJsonSerialization {false} |
true to make all connections use JSON serialization | |
bool | observer {false} |
true for connections that are for observation only | |
std::chrono::milliseconds | connectionTimeout {4000} |
int | maxMessageSize = 16 * 1024 |
the maximum message size for the queues (if needed) | |
int | maxMessageCount = 512 |
the maximum number of message to buffer (if needed) | |
std::atomic< bool > | requestDisconnect {false} |
flag gets set when disconnect is called | |
std::function< void(ActionMessage &&)> | ActionCallback |
the callback for what to do with a received message | |
std::function< void(int level, std::string_view name, std::string_view message)> | loggingCallback |
callback for logging | |
gmlc::containers::BlockingPriorityQueue< std::pair< route_id, ActionMessage > > | txQueue |
set of messages waiting to be transmitted | |
std::atomic< bool > | disconnecting |
flag indicating that the comm system is in the process of disconnecting More... | |
gmlc::networking::InterfaceNetworks | interfaceNetwork |
implementation for the communication interface that uses ZMQ messages to communicate
|
noexcept |
default constructor
helics::zeromq::ZmqComms::~ZmqComms | ( | ) |
destructor
References helics::CommsInterface::disconnect().
|
overridevirtual |
load network information into the comms object
Reimplemented from helics::NetworkCommsInterface.
References helics::CommsInterface::brokerTargetAddress, helics::NetworkCommsInterface::loadNetworkInfo(), helics::CommsInterface::localTargetAddress, and helics::CommsInterface::propertyLock().