helics 3.7.0
Loading...
Searching...
No Matches
BrokerServer.hpp
1/*
2Copyright (c) 2017-2026,
3Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Energy
4Innovation LLC. See the top-level NOTICE for additional details. All rights reserved.
5SPDX-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
18namespace helics {
19class ActionMessage;
20class helicsCLI11App;
21
22namespace fileops {
23 class JsonStorage;
24}
25
26using portData = std::vector<std::tuple<int, bool, std::shared_ptr<Broker>>>;
27
28namespace apps {
29 class TypedBrokerServer;
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);
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
Definition BrokerServer.hpp:32
~BrokerServer()
Definition BrokerServer.cpp:52
void forceTerminate()
Definition BrokerServer.cpp:137
void closeServers()
Definition BrokerServer.cpp:151
void startServers()
Definition BrokerServer.cpp:57
BrokerServer() noexcept
Definition BrokerServer.cpp:28
static bool hasActiveBrokers()
Definition BrokerServer.cpp:132
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition AsyncFedCallInfo.hpp:14