| helics 3.6.1

TcpBroker.h
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 "../../core/CoreTypes.hpp"
10 #include "../NetworkBroker.hpp"
11
12 #include <memory>
13 #include <string>
14 #include <vector>
15
16 namespace helics {
17 namespace tcp {
18 class TcpComms;
19 class TcpCommsSS;
21 using TcpBroker = NetworkBroker<TcpComms,
22 gmlc::networking::InterfaceTypes::TCP,
23 static_cast<int>(CoreType::TCP)>;
24
26 class TcpBrokerSS final:
27 public NetworkBroker<TcpCommsSS,
28 gmlc::networking::InterfaceTypes::TCP,
29 static_cast<int>(CoreType::TCP_SS)> {
30 public:
32 explicit TcpBrokerSS(bool rootBroker = false) noexcept;
33 explicit TcpBrokerSS(std::string_view broker_name);
34
35 protected:
36 virtual std::shared_ptr<helicsCLI11App> generateCLI() override;
37
38 private:
39 virtual bool brokerConnect() override;
40 bool no_outgoing_connections = false;
41 std::vector<std::string>
42 connections;
44 };
45
46 } // namespace tcp
47 } // namespace helics
helics::NetworkBroker
Definition: NetworkBroker.hpp:18
helics::tcp::TcpBrokerSS
Definition: TcpBroker.h:29
helics::tcp::TcpBrokerSS::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: TcpBroker.cpp:27
helics::tcp::TcpBrokerSS::TcpBrokerSS
TcpBrokerSS(bool rootBroker=false) noexcept
Definition: TcpBroker.cpp:23
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::CoreType::TCP
@ TCP
use a generic TCP protocol message stream to send messages