| helics 3.6.1

BrokerServer.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
8 #pragma once
9 #include "../core/Broker.hpp"
10
11 #include <atomic>
12 #include <memory>
13 #include <string>
14 #include <thread>
15 #include <tuple>
16 #include <vector>
17
18 namespace helics {
19 class ActionMessage;
20 class helicsCLI11App;
21
22 namespace fileops {
23 class JsonStorage;
24 }
25
26 using portData = std::vector<std::tuple<int, bool, std::shared_ptr<Broker>>>;
27
28 namespace apps {
29 class TypedBrokerServer;
32 class BrokerServer {
33 protected:
34 public:
36 BrokerServer() noexcept;
41 BrokerServer(int argc, char* argv[]);
45 explicit BrokerServer(std::vector<std::string> args);
49 explicit BrokerServer(std::string_view configFile);
51 ~BrokerServer();
53 void startServers();
55 static bool hasActiveBrokers();
57 void forceTerminate();
59 void closeServers();
60
61 private:
63 std::unique_ptr<helicsCLI11App> generateArgProcessing();
64
65 private:
66 bool zmq_server{false};
67 bool zmq_ss_server{false};
68 bool tcp_server{false};
69 bool udp_server{false};
70 // bool mpi_server{false}; //!< activate the MPI broker server
71 bool http_server{false};
72 bool websocket_server{false};
73 std::atomic<bool> exitall{false};
74 std::vector<std::shared_ptr<TypedBrokerServer>> servers;
75 std::string configFile_;
76 std::string server_name_;
77 std::unique_ptr<fileops::JsonStorage> config_;
78 std::string mHttpArgs;
79 std::string mWebSocketArgs;
80 std::string mZmqArgs;
81 std::string mTcpArgs;
82 std::string mUdpArgs;
83 std::string mMpiArgs;
84
85 public:
86 };
87 } // namespace apps
88 } // namespace helics
helics::apps::BrokerServer
Definition: BrokerServer.hpp:32
helics::apps::BrokerServer::~BrokerServer
~BrokerServer()
Definition: BrokerServer.cpp:52
helics::apps::BrokerServer::forceTerminate
void forceTerminate()
Definition: BrokerServer.cpp:137
helics::apps::BrokerServer::closeServers
void closeServers()
Definition: BrokerServer.cpp:151
helics::apps::BrokerServer::startServers
void startServers()
Definition: BrokerServer.cpp:57
helics::apps::BrokerServer::BrokerServer
BrokerServer() noexcept
Definition: BrokerServer.cpp:28
helics::apps::BrokerServer::hasActiveBrokers
static bool hasActiveBrokers()
Definition: BrokerServer.cpp:132
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14