ApplicationInstance Class Reference

Class containing data about the instance of an application. Provides methods to get and set the data. It is only representative and doesn't actually synchronize with the configuration files. More...

#include <ArmarXCore/util/ScenarioManagerCommon/data_structure/ApplicationInstance.h>

+ Inheritance diagram for ApplicationInstance:

Public Member Functions

void addProperty (std::string name, std::string value)
 Adds a new property with the specified name and value to this ApplicationInstance. More...
 
 ApplicationInstance (Application application, std::string instanceName, std::string configPath, ScenarioPtr scenarioName, std::string node, bool enabled)
 Constructor that sets the base data of this ApplicationInstance. More...
 
 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. More...
 
void copyFrom (ApplicationInstance &other)
 copyFrom Copy the other instance configuration to this one. More...
 
void deleteConfig ()
 
std::string getConfigDomain () const
 
std::string getConfigPath ()
 
std::string getEffectiveNodeName () const
 
bool getEnabled ()
 
std::string getInstanceName ()
 
std::string getNodeName () const
 
int getPid ()
 
ScenarioPtr getScenario ()
 
std::string getStatus ()
 Returns the status. More...
 
bool getStatusWriteBlock ()
 
bool isConfigWritable ()
 
bool isReadOnly () const
 
void linkFrom (ApplicationInstance &other)
 linkFrom Link this instance configuration from the other instance. More...
 
void load (bool firstLoad=false)
 Loades the IceProperties from the configPath Firstload determins if properties that equal their default value get uncommented. More...
 
void makeLocal ()
 Make a local copy of this instance if it is linked and nothing otherwise. More...
 
void modifyProperty (std::string name, std::string value)
 Changes the value of the specified property. More...
 
void resetConfigPath ()
 resetConfigPath. More...
 
void save ()
 Saves the IceProperties to the configPath. More...
 
void setConfigDomain (const std::string &value)
 
void setConfigPath (std::string configPath)
 Sets the config path of this ApplicationInstance. More...
 
void setEnabled (bool enabled)
 
void setInstanceName (std::string newName)
 Sets the name of this ApplicationInstance. More...
 
void setNodeName (std::string nodeName)
 
void setPid (int pid)
 Sets the pid of this ApplicationInstance. More...
 
bool setStatus (const std::string &status)
 Sets the status of this ApplicationInstance. More...
 
void setStatusWriteBlock (bool blocked)
 
- Public Member Functions inherited from Application
 Application (Application &app)
 Copy constructor. More...
 
 Application (std::string name, std::string executablePath, std::string packageName)
 Constructor that sets the name and the path to the executable of the application. More...
 
std::string getExecutableAbsPath ()
 
std::string getExecutableName ()
 
bool getFound ()
 
std::string getName ()
 
std::string getPackageName ()
 
std::string getPathToExecutable ()
 
armarx::PropertyDefinitionsPtr getProperties ()
 
bool isDefaultProperty (std::string name)
 
bool isDefaultPropertyEnabled (std::string name)
 
void setDefaultPropertyEnabled (std::string name, bool enabled)
 
void setIsDefaultProperty (std::string name, bool defaultValue)
 
void setProperties (armarx::PropertyDefinitionsPtr properties)
 Sets the properties of this application. More...
 
void updateFound ()
 

Additional Inherited Members

- Protected Attributes inherited from Application
PropertyEnabledMap defaultMap
 
PropertyEnabledMap enabledMap
 
armarx::PropertyDefinitionsPtr properties
 

Detailed Description

Class containing data about the instance of an application. Provides methods to get and set the data. It is only representative and doesn't actually synchronize with the configuration files.

Definition at line 63 of file ApplicationInstance.h.

Constructor & Destructor Documentation

◆ ApplicationInstance() [1/2]

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.

Parameters
executableNameThe name of the Application
executablePathThe path of the Executable
instanceNamea name that distinguishes this instance from other instances
configPathpath to the config file of this instance

◆ ApplicationInstance() [2/2]

ApplicationInstance ( Application  application,
std::string  instanceName,
std::string  configPath,
ScenarioPtr  scenarioName,
std::string  node,
bool  enabled 
)

Constructor that sets the base data of this ApplicationInstance.

Parameters
applicationThe application this class instantiates.
instanceNamea name that distinguishes this instance from other instances
configPathpath to the config file of this instance

Member Function Documentation

◆ addProperty()

void addProperty ( std::string  name,
std::string  value 
)

Adds a new property with the specified name and value to this ApplicationInstance.

Parameters
namename of the new property
valuevalue of the new property

Definition at line 175 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ copyFrom()

void copyFrom ( ApplicationInstance other)

copyFrom Copy the other instance configuration to this one.

Parameters
otherthe instance to copy

Definition at line 218 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ deleteConfig()

void deleteConfig ( )

Definition at line 227 of file ApplicationInstance.cpp.

◆ getConfigDomain()

std::string getConfigDomain ( ) const

Definition at line 50 of file ApplicationInstance.cpp.

◆ getConfigPath()

std::string getConfigPath ( )
Returns
config path of this ApplicationInstance

Definition at line 107 of file ApplicationInstance.cpp.

◆ getEffectiveNodeName()

std::string getEffectiveNodeName ( ) const

Definition at line 276 of file ApplicationInstance.cpp.

◆ getEnabled()

bool getEnabled ( )

Definition at line 286 of file ApplicationInstance.cpp.

◆ getInstanceName()

std::string getInstanceName ( )
Returns
name of this ApplicationInstance

Definition at line 97 of file ApplicationInstance.cpp.

◆ getNodeName()

std::string getNodeName ( ) const

Definition at line 271 of file ApplicationInstance.cpp.

◆ getPid()

int getPid ( )
Returns
pid of this ApplicationInstance

Definition at line 156 of file ApplicationInstance.cpp.

◆ getScenario()

Data_Structure::ScenarioPtr getScenario ( )

Definition at line 92 of file ApplicationInstance.cpp.

◆ getStatus()

std::string getStatus ( )

Returns the status.

Doesn't update automatically, is not necessarily synchronized with the actual status of the process. Use the Executor to get the actual status of this application.

Returns
status of this ApplicationInstance
See also
Executor

Definition at line 141 of file ApplicationInstance.cpp.

◆ getStatusWriteBlock()

bool getStatusWriteBlock ( )

Definition at line 261 of file ApplicationInstance.cpp.

◆ isConfigWritable()

bool isConfigWritable ( )

Definition at line 251 of file ApplicationInstance.cpp.

◆ isReadOnly()

bool isReadOnly ( ) const

Definition at line 61 of file ApplicationInstance.cpp.

◆ linkFrom()

void linkFrom ( ApplicationInstance other)

linkFrom Link this instance configuration from the other instance.

Parameters
otherthe source instance

Definition at line 209 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ load()

void load ( bool  firstLoad = false)

Loades the IceProperties from the configPath Firstload determins if properties that equal their default value get uncommented.

Definition at line 235 of file ApplicationInstance.cpp.

◆ makeLocal()

void makeLocal ( )

Make a local copy of this instance if it is linked and nothing otherwise.

Definition at line 190 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ modifyProperty()

void modifyProperty ( std::string  name,
std::string  value 
)

Changes the value of the specified property.

Parameters
namename of the property whose value is to be changed
valuenew value of the property

Definition at line 166 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ resetConfigPath()

void resetConfigPath ( )

resetConfigPath.

should be called when the instanceName is changed/ deletes the old cfg file and resets the local config Path to where the file should be you should call save after this

Definition at line 117 of file ApplicationInstance.cpp.

◆ save()

void save ( )

Saves the IceProperties to the configPath.

Definition at line 184 of file ApplicationInstance.cpp.

◆ setConfigDomain()

void setConfigDomain ( const std::string &  value)

Definition at line 55 of file ApplicationInstance.cpp.

+ Here is the call graph for this function:

◆ setConfigPath()

void setConfigPath ( std::string  configPath)

Sets the config path of this ApplicationInstance.

Parameters
newconfig path

Definition at line 112 of file ApplicationInstance.cpp.

◆ setEnabled()

void setEnabled ( bool  enabled)

Definition at line 291 of file ApplicationInstance.cpp.

◆ setInstanceName()

void setInstanceName ( std::string  newName)

Sets the name of this ApplicationInstance.

Parameters
newname

Definition at line 102 of file ApplicationInstance.cpp.

◆ setNodeName()

void setNodeName ( std::string  nodeName)

Definition at line 281 of file ApplicationInstance.cpp.

◆ setPid()

void setPid ( int  pid)

Sets the pid of this ApplicationInstance.

This pid gets used by the Executor to stop this application, therefore it is not suggested to set this to random values. Set this to -1, if no pid is known.

Parameters
pidnew pid

Definition at line 161 of file ApplicationInstance.cpp.

◆ setStatus()

bool setStatus ( const std::string &  status)

Sets the status of this ApplicationInstance.

Parameters
newstatus. Should be either "running" or "stopped" for Scenario statuses to work properly.
Returns
tree if status changed.

Definition at line 146 of file ApplicationInstance.cpp.

◆ setStatusWriteBlock()

void setStatusWriteBlock ( bool  blocked)

Definition at line 266 of file ApplicationInstance.cpp.


The documentation for this class was generated from the following files: