helics  3.5.2
NetworkBroker.hpp
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 "CommsBroker.hpp"
10 #include "NetworkBrokerData.hpp"
11 #include "helics/core/CoreBroker.hpp"
12 
13 #include <memory>
14 #include <string>
15 
16 namespace helics {
17 template<class COMMS, gmlc::networking::InterfaceTypes baseline, int tcode = 0>
18 class NetworkBroker: public CommsBroker<COMMS, CoreBroker> {
19  public:
21  explicit NetworkBroker(bool rootBroker = false) noexcept;
22  explicit NetworkBroker(std::string_view broker_name);
23 
24  public:
25  virtual std::string generateLocalAddressString() const override;
26 
27  protected:
28  virtual std::shared_ptr<helicsCLI11App> generateCLI() override;
29  virtual bool brokerConnect() override;
30  mutable std::mutex dataMutex;
32 };
33 
34 } // namespace helics
Definition: CommsBroker.hpp:21
Definition: NetworkBrokerData.hpp:23
Definition: NetworkBroker.hpp:18
NetworkBroker(bool rootBroker=false) noexcept
Definition: NetworkBroker_impl.hpp:47
virtual bool brokerConnect() override
Definition: NetworkBroker_impl.hpp:70
std::mutex dataMutex
mutex protecting the configuration information
Definition: NetworkBroker.hpp:30
NetworkBrokerData netInfo
structure containing the networking information
Definition: NetworkBroker.hpp:31
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: NetworkBroker_impl.hpp:61
virtual std::string generateLocalAddressString() const override
Definition: NetworkBroker_impl.hpp:92
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14