| helics 3.6.1

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