9 #include "../core/CoreTypes.hpp"
10 #include "helics_cxx_export.h"
32 explicit CoreApp(std::vector<std::string> args);
44 CoreApp(
CoreType ctype, std::string_view coreName, std::vector<std::string> args);
49 CoreApp(
int argc,
char* argv[]);
56 CoreApp(
CoreType ctype, std::string_view coreName,
int argc,
char* argv[]);
66 explicit CoreApp(std::string_view argString);
77 CoreApp(
CoreType ctype, std::string_view coreName, std::string_view argString);
80 explicit CoreApp(std::shared_ptr<Core> cr);
82 bool isConnected()
const;
89 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;
119 std::string query(std::string_view target,
120 std::string_view queryStr,
128 void setTag(std::string_view tag, std::string_view value =
"true");
135 const std::string& getTag(std::string_view tag)
const;
144 void setGlobal(std::string_view valueName, std::string_view value =
"true");
154 void sendCommand(std::string_view target,
155 std::string_view commandStr,
159 void setLogFile(std::string_view logFile);
161 void setLoggingLevel(
int loglevel);
163 void setReadyToInit();
166 #ifdef HELICS_CXX_STATIC_DEFINE
169 auto* operator->()
const {
return core.operator->(); }
171 CoreApp* operator->() {
return this; }
172 const CoreApp* operator->()
const {
return this; }
180 void globalError(int32_t errorCode, std::string_view errorString);
183 void processArgs(std::unique_ptr<helicsCLI11App>& app);
184 std::unique_ptr<helicsCLI11App> generateParser();
186 std::shared_ptr<Core> core;
193 template<
class... Args>
194 explicit CoreKeeper(Args&&... args): cr(std::forward<Args...>(args...))
Definition: application_api/CoreApp.hpp:25
bool waitForDisconnect(std::chrono::milliseconds waitTime=std::chrono::milliseconds(0))
Definition: CoreApp.cpp:160
void forceTerminate()
Definition: CoreApp.cpp:150
std::shared_ptr< Core > getCopyofCorePointer() const
Definition: application_api/CoreApp.hpp:175
bool isConnected() const
Definition: CoreApp.cpp:135
Definition: application_api/CoreApp.hpp:191
~CoreKeeper()
the destructor waits for the core to terminate
Definition: application_api/CoreApp.hpp:206
bool isConnected()
is the core connected
Definition: application_api/CoreApp.hpp:202
void forceTerminate()
Force terminate the core.
Definition: application_api/CoreApp.hpp:204
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