96 static std::string
Aggregate(
const std::vector<std::string>& stati);
108 public std::enable_shared_from_this<ApplicationInstance>
112 std::string instanceName;
113 std::filesystem::path configPath;
115 std::string nodeName;
116 std::string configDomain;
119 std::atomic<int> pid;
121 std::atomic<Intent> pendingIntent;
134 std::string executablePath,
135 std::string instanceName,
136 std::string configPath,
137 std::string packageName,
149 std::string instanceName,
150 std::string configPath,
200 bool setStatus(
const std::string& status);
250 void addProperty(std::string name, std::string value);
281 void load(
bool firstLoad =
false);
Class containing data about the instance of an application.
ApplicationInstance(std::string executableName, std::string executablePath, std::string instanceName, std::string configPath, std::string packageName, ScenarioPtr scenarioName, std::string node, bool enabled)
Constructor that sets the base data of this ApplicationInstance.
void setInstanceName(std::string newName)
Sets the name of this ApplicationInstance.
std::string getInstanceName()
void setEnabled(bool enabled)
void setPid(int pid)
Sets the pid of this ApplicationInstance.
void resetConfigPath()
resetConfigPath.
void addProperty(std::string name, std::string value)
Adds a new property with the specified name and value to this ApplicationInstance.
void setConfigPath(std::string configPath)
Sets the config path of this ApplicationInstance.
std::string getConfigDomain() const
bool adoptPidIfUnset(int newPid)
Sets the pid to newPid, but only if no pid is currently known (i.e.
void setPendingIntent(Intent intent)
std::string getConfigPath()
std::string getEffectiveNodeName() const
ScenarioPtr getScenario()
Intent getPendingIntent() const
The intent this application is currently moving towards, or None when idle.
void modifyProperty(std::string name, std::string value)
Changes the value of the specified property.
void setConfigDomain(const std::string &value)
std::string getStatus()
Returns the status.
void makeLocal()
Make a local copy of this instance if it is linked and nothing otherwise.
void save()
Saves the IceProperties to the configPath.
void copyFrom(ApplicationInstance &other)
copyFrom Copy the other instance configuration to this one.
void linkFrom(ApplicationInstance &other)
linkFrom Link this instance configuration from the other instance.
bool compareAndResetPid(int expectedPid)
Sets the pid to -1, but only if it is still expectedPid.
void load(bool firstLoad=false)
Loades the IceProperties from the configPath Firstload determins if properties that equal their defau...
void setNodeName(std::string nodeName)
bool setStatus(const std::string &status)
Sets the status of this ApplicationInstance.
std::string getNodeName() const
Application(std::string name, std::string executablePath, std::string packageName)
Constructor that sets the name and the path to the executable of the application.
std::shared_ptr< Scenario > ScenarioPtr
Intent
What the ScenarioManager is currently trying to do with an application.
const char * ToString(Intent intent)
Human readable name of an intent, for logging.
std::weak_ptr< ApplicationInstance > ApplicationInstanceWPtr
std::shared_ptr< ApplicationInstance > ApplicationInstancePtr
std::shared_ptr< std::vector< ApplicationInstancePtr > > ApplicationInstanceVectorPtr
static const std::string Stopped
static const std::string Mixed
static const std::string Missing
static const std::string Unknown
static const std::string Inactive
static const std::string Waiting
static std::string Aggregate(const std::vector< std::string > &stati)
Combines the stati of several applications into the status of their common parent (a scenario or the ...
static const std::string Running