helics  3.5.2
ZmqCommsSS.h
1 /*
2 Copyright (c) 2017-2024,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 
8 #pragma once
9 
10 #include "../NetworkCommsInterface.hpp"
11 
12 #include <atomic>
13 #include <map>
14 #include <set>
15 #include <string>
16 
17 namespace zmq {
18 class message_t;
19 class socket_t;
20 } // namespace zmq
21 
22 namespace helics {
23 namespace zeromq {
26  class ZmqCommsSS final: public NetworkCommsInterface {
27  public:
29  ZmqCommsSS() noexcept;
31  ~ZmqCommsSS() final;
33  virtual void loadNetworkInfo(const NetworkBrokerData& netInfo) override;
36  private:
37  virtual int getDefaultBrokerPort() const override;
38  virtual void queue_rx_function() override;
39  virtual void queue_tx_function() override;
42  int processIncomingMessage(zmq::message_t& msg,
43  std::map<std::string, std::string>& connection_info);
46  bool processTxControlCmd(const ActionMessage& cmd,
47  std::map<route_id, std::string>& routes,
48  std::map<std::string, std::string>& connection_info);
49 
51  int processRxMessage(zmq::socket_t& socket,
52  std::map<std::string, std::string>& connection_info);
55  int replyToIncomingMessage(zmq::message_t& msg, zmq::socket_t& sock);
56 
57  int initializeConnectionToBroker(zmq::socket_t& brokerConnection);
58 
59  int initializeBrokerConnections(zmq::socket_t& brokerSocket,
60  zmq::socket_t& brokerConnection);
61  };
62 
63 } // namespace zeromq
64 } // namespace helics
Definition: ActionMessage.hpp:30
Definition: NetworkBrokerData.hpp:23
Definition: NetworkCommsInterface.hpp:18
Definition: ZmqCommsSS.h:26
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: ZmqCommsSS.cpp:27
~ZmqCommsSS() final
Definition: ZmqCommsSS.cpp:61
ZmqCommsSS() noexcept
Definition: ZmqCommsSS.cpp:53
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14