| helics 3.6.1

NetworkBroker.hpp
1 /*
2 Copyright (c) 2017-2025,
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;
31 NetworkBrokerData netInfo{baseline};
32 };
33
34 } // namespace helics
helics::CommsBroker
Definition: CommsBroker.hpp:21
helics::NetworkBrokerData
Definition: NetworkBrokerData.hpp:23
helics::NetworkBroker
Definition: NetworkBroker.hpp:18
helics::NetworkBroker::NetworkBroker
NetworkBroker(bool rootBroker=false) noexcept
Definition: NetworkBroker_impl.hpp:47
helics::NetworkBroker::brokerConnect
virtual bool brokerConnect() override
Definition: NetworkBroker_impl.hpp:70
helics::NetworkBroker::dataMutex
std::mutex dataMutex
mutex protecting the configuration information
Definition: NetworkBroker.hpp:30
helics::NetworkBroker::netInfo
NetworkBrokerData netInfo
structure containing the networking information
Definition: NetworkBroker.hpp:31
helics::NetworkBroker::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: NetworkBroker_impl.hpp:61
helics::NetworkBroker::generateLocalAddressString
virtual std::string generateLocalAddressString() const override
Definition: NetworkBroker_impl.hpp:92
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14