9 #include "../core/CoreTypes.hpp"
10 #include "../core/helicsTime.hpp"
11 #include "helics_cxx_export.h"
33 explicit BrokerApp(std::vector<std::string>&& args);
44 BrokerApp(
CoreType ctype,
const std::string& broker_name, std::vector<std::string>&& args);
48 explicit BrokerApp(std::vector<std::string>& args);
59 BrokerApp(
CoreType ctype,
const std::string& broker_name, std::vector<std::string>& args);
81 explicit BrokerApp(std::string_view argString);
86 explicit BrokerApp(
CoreType ctype, std::string_view argString = std::string_view{});
92 BrokerApp(
CoreType ctype, std::string_view brokerName, std::string_view argString);
95 explicit BrokerApp(std::shared_ptr<Broker> brk);
98 bool isConnected()
const;
103 bool isOpenToNewFederates()
const;
106 void forceTerminate();
108 bool waitForDisconnect(std::chrono::milliseconds waitTime = std::chrono::milliseconds(0));
110 void linkEndpoints(std::string_view source, std::string_view target);
112 void dataLink(std::string_view source, std::string_view target);
114 void addSourceFilterToEndpoint(std::string_view filter, std::string_view endpoint);
116 void addDestinationFilterToEndpoint(std::string_view filter, std::string_view endpoint);
118 void addAlias(std::string_view interfaceName, std::string_view alias);
120 void makeConnections(
const std::string& file);
122 const std::string& getIdentifier()
const;
124 const std::string& getAddress()
const;
133 std::string query(std::string_view target,
134 std::string_view queryStr,
143 void setGlobal(std::string_view valueName, std::string_view value);
153 void sendCommand(std::string_view target,
154 std::string_view commandStr,
158 void setLogFile(std::string_view logFile);
160 void setLoggingLevel(
int loglevel);
163 #ifdef HELICS_CXX_STATIC_DEFINE
166 auto* operator->()
const {
return broker.operator->(); }
168 BrokerApp* operator->() {
return this; }
169 const BrokerApp* operator->()
const {
return this; }
175 void setTimeBarrier(
Time barrierTime);
177 void clearTimeBarrier();
179 void globalError(int32_t errorCode, std::string_view errorString);
182 void processArgs(std::unique_ptr<helicsCLI11App>& app);
183 std::unique_ptr<helicsCLI11App> generateParser(
bool noTypeOption =
false);
184 std::shared_ptr<Broker> broker;
191 template<
class... Args>
192 explicit BrokerKeeper(Args&&... args): brk(std::forward<Args...>(args...))
Definition: application_api/BrokerApp.hpp:26
void forceTerminate()
Definition: BrokerApp.cpp:189
std::shared_ptr< Broker > getCopyofBrokerPointer() const
Definition: application_api/BrokerApp.hpp:172
bool waitForDisconnect(std::chrono::milliseconds waitTime=std::chrono::milliseconds(0))
Definition: BrokerApp.cpp:127
bool isConnected() const
Definition: BrokerApp.cpp:174
Definition: application_api/BrokerApp.hpp:189
void forceTerminate()
Force terminate the broker.
Definition: application_api/BrokerApp.hpp:202
~BrokerKeeper()
the destructor waits for the broker to terminate
Definition: application_api/BrokerApp.hpp:204
bool isConnected()
is the broker connected
Definition: application_api/BrokerApp.hpp:200
HelicsSequencingModes
Definition: helics_enums.h:427
@ HELICS_SEQUENCING_MODE_FAST
Definition: helics_enums.h:429
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
CoreType
Definition: CoreTypes.hpp:46
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27