helics  2.8.1
TcpCore.h
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 "../NetworkCore.hpp"
10 
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
15 namespace helics {
16 namespace tcp {
17  class TcpComms;
18  class TcpCommsSS;
20  using TcpCore = NetworkCore<TcpComms, interface_type::tcp>;
21 
23  class TcpCoreSS final: public NetworkCore<TcpCommsSS, interface_type::tcp> {
24  public:
26  TcpCoreSS() noexcept;
27  TcpCoreSS(const std::string& coreName);
28 
29  protected:
30  virtual std::shared_ptr<helicsCLI11App> generateCLI() override;
31 
32  private:
33  std::vector<std::string> connections;
34  bool no_outgoing_connections = false;
35  virtual bool brokerConnect() override;
36  };
37 
38 } // namespace tcp
39 } // namespace helics
helics::CommsBroker< TcpCommsSS, CommonCore >::comms
std::unique_ptr< TcpCommsSS > comms
the actual comms object
Definition: CommsBroker.hpp:24
helics::NetworkCore::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: NetworkCore_impl.hpp:37
helics::tcp::TcpCoreSS::TcpCoreSS
TcpCoreSS() noexcept
Definition: TcpCore.cpp:20
helics::tcp::TcpCoreSS::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: TcpCore.cpp:24
helics::NetworkCore< TcpCommsSS, interface_type::tcp >::dataMutex
std::mutex dataMutex
mutex protecting the configuration information
Definition: NetworkCore.hpp:30
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::tcp::TcpCoreSS
Definition: TcpCore.h:23
helics::NetworkCore::brokerConnect
virtual bool brokerConnect() override
Definition: NetworkCore_impl.hpp:47