helics  3.0.1
NetworkCore.hpp
1 /*
2 Copyright (c) 2017-2021,
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 template<class COMMS, InterfaceTypes baseline = InterfaceTypes::IP>
18 class NetworkCore: public CommsBroker<COMMS, CommonCore> {
19  public:
21  NetworkCore() noexcept;
22  explicit NetworkCore(const std::string& 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
helics::NetworkBrokerData
Definition: NetworkBrokerData.hpp:36
helics::CommsBroker
Definition: CommsBroker.hpp:21
helics::NetworkCore::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: NetworkCore_impl.hpp:37
helics::NetworkCore::netInfo
NetworkBrokerData netInfo
structure containing the networking information
Definition: NetworkCore.hpp:31
helics::NetworkCore::generateLocalAddressString
virtual std::string generateLocalAddressString() const override
Definition: NetworkCore_impl.hpp:71
helics::NetworkCore::dataMutex
std::mutex dataMutex
mutex protecting the configuration information
Definition: NetworkCore.hpp:30
helics::NetworkCore::NetworkCore
NetworkCore() noexcept
Definition: NetworkCore_impl.hpp:24
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::NetworkCore
Definition: NetworkCore.hpp:18
helics::NetworkCore::brokerConnect
virtual bool brokerConnect() override
Definition: NetworkCore_impl.hpp:47