9 #include "../application_api/CombinationFederate.hpp"
14 #include <string_view>
24 namespace helics::apps {
32 class HELICS_CXX_EXPORT
App {
40 App(std::string_view defaultAppName, std::vector<std::string> args);
46 App(std::string_view defaultAppName,
int argc,
char* argv[]);
58 App(std::string_view appName,
const std::shared_ptr<Core>& core,
const FederateInfo& fedInfo);
64 App(std::string_view appName, CoreApp& core,
const FederateInfo& fedInfo);
71 App(std::string_view appName,
const std::string& configString);
90 void loadFile(
const std::string& filename,
bool enableFederateInterfaceRegistration =
true);
97 virtual void initialize();
107 virtual void finalize();
118 virtual void loadJsonFile(
const std::string& jsonString,
119 bool enableFederateInterfaceRegistration);
125 void loadJsonFileConfiguration(
const std::string& appName,
126 const std::string& jsonString,
127 bool enableFederateInterfaceRegistration);
129 virtual void loadTextFile(
const std::string& textFile);
131 void loadInputFiles();
136 void loadConfigOptions(
const Json::Value& element);
138 std::unique_ptr<helicsCLI11App> generateParser();
140 void processArgs(std::unique_ptr<helicsCLI11App>& app,
142 std::string_view defaultAppName);
145 std::shared_ptr<CombinationFederate>
fed;
146 Time stopTime = Time::maxVal();
149 bool useLocal{
false};
150 bool fileLoaded{
false};
151 bool deactivated{
false};
152 bool quietMode{
false};
153 bool helpMode{
false};
154 std::vector<std::string> remArgs;
161 std::vector<int>
preParseFile(
const std::vector<char>& klines);
163 const std::string& configString()
const {
return configStr; }
169 bool mLineComment{
false};
170 std::ifstream filePtr;
171 std::string configStr;
172 std::string mFileName;
173 int currentLineNumber{0};
Definition: application_api/CombinationFederate.hpp:18
Definition: FederateInfo.hpp:29
Definition: helicsApp.hpp:157
std::vector< int > preParseFile(const std::vector< char > &klines)
Definition: helicsApp.cpp:146
bool loadNextLine(std::string &line, int &lineNumber)
Definition: helicsApp.cpp:193
Definition: helicsApp.hpp:32
std::string inputFileName
the name of the app input file
Definition: helicsApp.hpp:148
std::string configFileName
name of the config file used for constructing the federate
Definition: helicsApp.hpp:147
App & operator=(App &&app)=default
std::shared_ptr< CombinationFederate > fed
the federate created for the App
Definition: helicsApp.hpp:145
virtual void runTo(Time stopTime_input)=0
App(const App &other_app)=delete
App(App &&other_app)=default
bool isActive() const
Definition: helicsApp.hpp:110
App & operator=(const App &app)=delete
const CombinationFederate & accessUnderlyingFederate() const
Definition: helicsApp.hpp:112
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27