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);
66 explicit BrokerApp(std::string_view argString);
71 explicit BrokerApp(
CoreType ctype, std::string_view argString = std::string_view{});
77 BrokerApp(
CoreType ctype, std::string_view brokerName, std::string_view argString);
80 explicit BrokerApp(std::shared_ptr<Broker> brk);
83 bool isConnected()
const;
88 bool isOpenToNewFederates()
const;
91 void forceTerminate();
93 bool waitForDisconnect(std::chrono::milliseconds waitTime = std::chrono::milliseconds(0));
95 void linkEndpoints(std::string_view source, std::string_view target);
97 void dataLink(std::string_view source, std::string_view target);
99 void addSourceFilterToEndpoint(std::string_view filter, std::string_view endpoint);
101 void addDestinationFilterToEndpoint(std::string_view filter, std::string_view endpoint);
103 void addAlias(std::string_view interfaceName, std::string_view alias);
105 void makeConnections(
const std::string& file);
107 const std::string& getIdentifier()
const;
109 const std::string& getAddress()
const;
118 std::string query(std::string_view target,
119 std::string_view queryStr,
128 void setGlobal(std::string_view valueName, std::string_view value);
138 void sendCommand(std::string_view target,
139 std::string_view commandStr,
143 void setLogFile(std::string_view logFile);
145 void setLoggingLevel(
int loglevel);
148 #ifdef HELICS_CXX_STATIC_DEFINE
151 auto* operator->()
const {
return broker.operator->(); }
153 BrokerApp* operator->() {
return this; }
154 const BrokerApp* operator->()
const {
return this; }
160 void setTimeBarrier(
Time barrierTime);
162 void clearTimeBarrier();
164 void globalError(int32_t errorCode, std::string_view errorString);
167 void processArgs(std::unique_ptr<helicsCLI11App>& app);
168 std::unique_ptr<helicsCLI11App> generateParser(
bool noTypeOption =
false);
169 std::shared_ptr<Broker> broker;
176 template<
class... Args>
177 explicit BrokerKeeper(Args&&... args): brk(std::forward<Args...>(args...))
Definition: application_api/BrokerApp.hpp:26
void forceTerminate()
Definition: BrokerApp.cpp:163
std::shared_ptr< Broker > getCopyofBrokerPointer() const
Definition: application_api/BrokerApp.hpp:157
bool waitForDisconnect(std::chrono::milliseconds waitTime=std::chrono::milliseconds(0))
Definition: BrokerApp.cpp:101
bool isConnected() const
Definition: BrokerApp.cpp:148
Definition: application_api/BrokerApp.hpp:174
void forceTerminate()
Force terminate the broker.
Definition: application_api/BrokerApp.hpp:187
~BrokerKeeper()
the destructor waits for the broker to terminate
Definition: application_api/BrokerApp.hpp:189
bool isConnected()
is the broker connected
Definition: application_api/BrokerApp.hpp:185
HelicsSequencingModes
Definition: helics_enums.h:425
@ HELICS_SEQUENCING_MODE_FAST
Definition: helics_enums.h:427
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