helics  3.5.2
UdpComms.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 #pragma once
8 
9 #include "../NetworkCommsInterface.hpp"
10 #include "helics/helics-config.h"
11 
12 #include <future>
13 #include <set>
14 
15 namespace helics {
16 namespace udp {
18  class UdpComms final: public NetworkCommsInterface {
19  public:
21  UdpComms();
23  ~UdpComms();
24 
25  virtual void loadNetworkInfo(const NetworkBrokerData& netInfo) override;
26 
27  private:
28  virtual int getDefaultBrokerPort() const override;
29  virtual void queue_rx_function() override;
30  virtual void queue_tx_function() override;
31  virtual void closeReceiver() override;
32 
33  // promise and future for communicating port number from tx_thread to rx_thread
34  std::promise<int> promisePort;
35  std::future<int> futurePort;
36 
37  public:
38  };
39 
40 } // namespace udp
41 } // namespace helics
Definition: NetworkBrokerData.hpp:23
Definition: NetworkCommsInterface.hpp:18
Definition: UdpComms.h:18
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: UdpComms.cpp:35
~UdpComms()
Definition: UdpComms.cpp:48
UdpComms()
Definition: UdpComms.cpp:24
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14