|
Starts, stops and restarts applications and scenarios. Can also be used to request the status of an application. The proper system-specific stopstrategy and starter have to be set in the constructor. More...
#include <ArmarXCore/util/ScenarioManagerCommon/executor/Executor.h>
Public Member Functions | |
Executor (StopStrategyPtr strategy, ApplicationStarterPtr starter) | |
Constructor that sets StopStrategy and ApplicationStarter. More... | |
std::string | getApplicationStatus (Data_Structure::ApplicationInstancePtr application) |
Returns the status of an application. More... | |
StopStrategyPtr | getDefaultStopStrategy () |
ApplicationStarterPtr | getStarter (Data_Structure::ScenarioPtr scenario) |
StopStrategyPtr | getStopStrategy (Data_Structure::ScenarioPtr scenario) |
void | loadAndSetCachedProperties (Data_Structure::ApplicationPtr application, std::string path, bool reload=false, bool set=true) |
Generates an XML file of the given application and saves it in the specified path. More... | |
std::future< void > | restartApplication (Data_Structure::ApplicationInstancePtr application, bool printOnly=false) |
Restarts an application. More... | |
std::future< void > | restartScenario (Data_Structure::ScenarioPtr scenario, bool printOnly=false) |
Restarts a scenario. More... | |
void | setDefaultStarter (ApplicationStarterPtr appStarter) |
Sets the appStarter this Executor uses to start applications and request statuses. More... | |
void | setDefaultStopStrategy (StopStrategyPtr strategy) |
Sets the strategy this Executor uses to stop applications. More... | |
void | setStarter (ApplicationStarterPtr appStarter, Data_Structure::ScenarioPtr scenario) |
void | setStopStrategy (StopStrategyPtr strategy, Data_Structure::ScenarioPtr scenario) |
std::future< void > | startApplication (Data_Structure::ApplicationInstancePtr application, bool printOnly=false, const std::string &commandLineParameters="") |
Starts an application. More... | |
std::future< void > | startScenario (Data_Structure::ScenarioPtr scenario, bool printOnly=false, const std::string &commandLineParameters="") |
Starts a scenario. More... | |
std::future< void > | stopApplication (Data_Structure::ApplicationInstancePtr application) |
Stops an application. More... | |
std::future< void > | stopScenario (Data_Structure::ScenarioPtr scenario) |
Stops a scenario. More... | |
Starts, stops and restarts applications and scenarios. Can also be used to request the status of an application. The proper system-specific stopstrategy and starter have to be set in the constructor.
Definition at line 54 of file Executor.h.
Executor | ( | Exec::StopStrategyPtr | strategy, |
Exec::ApplicationStarterPtr | starter | ||
) |
Constructor that sets StopStrategy and ApplicationStarter.
strategy | Strategy used to stop applications. |
starter | Starter used to start applications and request their status. |
Definition at line 39 of file Executor.cpp.
std::string getApplicationStatus | ( | Data_Structure::ApplicationInstancePtr | application | ) |
Returns the status of an application.
Uses the ApplicationStarter to request the status, therefore the proper system-specific starter has to be set, even to use this method.
application | application whose status is returned |
Definition at line 125 of file Executor.cpp.
Exec::StopStrategyPtr getDefaultStopStrategy | ( | ) |
Definition at line 283 of file Executor.cpp.
Exec::ApplicationStarterPtr getStarter | ( | Data_Structure::ScenarioPtr | scenario | ) |
Definition at line 265 of file Executor.cpp.
Exec::StopStrategyPtr getStopStrategy | ( | Data_Structure::ScenarioPtr | scenario | ) |
Definition at line 274 of file Executor.cpp.
void loadAndSetCachedProperties | ( | Data_Structure::ApplicationPtr | application, |
std::string | path, | ||
bool | reload = false , |
||
bool | set = true |
||
) |
Generates an XML file of the given application and saves it in the specified path.
If there already is an XML file at that location it only reloads the file if the executable is more recently changed than the Xml file
application | Application whose XML file is to be generate |
path | location to save the XML, must be a folder |
reload | forces to reload the cached XML |
set | if true the newly Cached Xml gets loaded into the Application (Warning: If you load an ApplicationInstance the cfg parameter have to be reloaded) |
Definition at line 205 of file Executor.cpp.
std::future< void > restartApplication | ( | Data_Structure::ApplicationInstancePtr | application, |
bool | printOnly = false |
||
) |
Restarts an application.
Stops and starts an application.
application | application to be restarted |
Definition at line 108 of file Executor.cpp.
std::future< void > restartScenario | ( | Data_Structure::ScenarioPtr | scenario, |
bool | printOnly = false |
||
) |
Restarts a scenario.
Iterates over the applications in the scenario and restarts them.
scenario | scenario to be restarted |
Definition at line 196 of file Executor.cpp.
void setDefaultStarter | ( | ApplicationStarterPtr | appStarter | ) |
Sets the appStarter this Executor uses to start applications and request statuses.
Needs to be system specific. Use the Factory-Classes to get the proper appStarter for your system.
appStarter | appStarter to be set |
Definition at line 250 of file Executor.cpp.
void setDefaultStopStrategy | ( | StopStrategyPtr | strategy | ) |
Sets the strategy this Executor uses to stop applications.
Needs to be system specific. Use the Factory-Classes to get the proper strategy for your system.
strategy | strategy to be set |
Definition at line 246 of file Executor.cpp.
void setStarter | ( | ApplicationStarterPtr | appStarter, |
Data_Structure::ScenarioPtr | scenario | ||
) |
Definition at line 260 of file Executor.cpp.
void setStopStrategy | ( | StopStrategyPtr | strategy, |
Data_Structure::ScenarioPtr | scenario | ||
) |
Definition at line 255 of file Executor.cpp.
std::future< void > startApplication | ( | Data_Structure::ApplicationInstancePtr | application, |
bool | printOnly = false , |
||
const std::string & | commandLineParameters = "" |
||
) |
Starts an application.
application | application to be started. |
Definition at line 45 of file Executor.cpp.
std::future< void > startScenario | ( | Data_Structure::ScenarioPtr | scenario, |
bool | printOnly = false , |
||
const std::string & | commandLineParameters = "" |
||
) |
Starts a scenario.
Iterates over the applications in the scenario and starts them.
scenario | scenario to be started |
Definition at line 134 of file Executor.cpp.
std::future< void > stopApplication | ( | Data_Structure::ApplicationInstancePtr | application | ) |
Stops an application.
application | application to be stopped |
Definition at line 68 of file Executor.cpp.
std::future< void > stopScenario | ( | Data_Structure::ScenarioPtr | scenario | ) |
Stops a scenario.
Iterates over the applications in the scenario and stops them.
scenario | scenario to be stopped |
Definition at line 173 of file Executor.cpp.