|
|
Baseclass for all ArmarX applications. More...
#include <ArmarXCore/core/application/Application.h>
Inheritance diagram for Application:Public Member Functions | |
| Application () | |
| Application initalizes the Ice::Application base class. | |
| void | enableLibLoading (bool enable=true) |
| std::vector< std::string > | getArmarXPackageNames () |
| getDefaultPackageNames returns the value of the ArmarX.DefaultPackages property It splits the string by , and returns the elements as a vector. | |
| const std::vector< std::string > & | getCommandLineArguments () const |
| bool | getForbidThreadCreation () const |
| std::string | getName () const |
| Retrieve name of the application. | |
| const ThreadPoolPtr & | getThreadPool () const |
| void | icePropertiesUpdated (const std::set< std::string > &changedProperties) override |
| This method is called when new Properties are set via setIceProperties(). | |
| void | interruptCallback (int signal) override |
| Cleans up connections with IceStorm before terminating the app. | |
| bool | isPackageAutoDiscoveryEnabled () |
| void | registerDataPathsFromDependencies (std::string dependencies) |
| int | run (int argc, char *argv[]) override |
| Ice::Application replacement for the main function. | |
| void | setForbidThreadCreation (bool value) |
| void | setIceProperties (Ice::PropertiesPtr properties) override |
| Overrides PropertyUser::setIceProperties() which is called internally. | |
| void | setName (const std::string &name) |
| Set name of the application. | |
| void | storeCommandLineArguments (int argc, char *argv[]) |
| void | updateIceProperties (const Ice::PropertyDict &properties) override |
Public Member Functions inherited from PropertyUser | |
| std::vector< std::string > | getComponentProxyNames () |
| Ice::PropertiesPtr | getIceProperties () const |
| Returns the set of Ice properties. | |
| template<typename PropertyType> | |
| Property< PropertyType > | getProperty (const std::string &name) |
| Property creation and retrieval. | |
| template<typename PropertyType> | |
| Property< PropertyType > | getProperty (const std::string &name) const |
Hack to allow using getProperty in const-modified methods. | |
| template<class T> | |
| void | getProperty (std::atomic< T > &val, const std::string &name) const |
| template<class T> | |
| void | getProperty (T &val, const std::string &name) const |
| template<class T> | |
| std::vector< T > | getPropertyAsCSV (const std::string &name, const std::string &splitBy=",;", bool trimElements=true, bool removeEmptyElements=true) |
| template<class ContainerT> | |
| void | getPropertyAsCSV (ContainerT &val, const std::string &name, const std::string &splitBy=",;", bool trimElements=true, bool removeEmptyElements=true) |
| PropertyDefinitionsPtr | getPropertyDefinitions () |
| Returns the component's property definition container. | |
| std::vector< std::string > | getSubscribedTopicNames () |
| std::vector< std::string > | getTopicProxyNames () |
| bool | hasProperty (const std::string &name) |
| virtual void | injectPropertyDefinitions (PropertyDefinitionsPtr &) |
| Called after createPropertyDefinitions by Component to inject propertes of ComponentPlugin. | |
| PropertyUser () | |
| bool | tryAddProperty (const std::string &propertyName, const std::string &value) |
| virtual void | updateIceProperties (const std::map< std::string, std::string > &changes) |
| void | updateProperties () |
| void | updateProxies (IceManagerPtr) |
| ~PropertyUser () override | |
Static Public Member Functions | |
| template<class T, typename... Args> | |
| static ApplicationPtr | createInstance (Args &&... args) |
| Creates the one application instance of type T. | |
| static std::string | GetArmarXConfigDefaultPath (bool envVarExpanded=true) |
| static Ice::StringSeq | GetDefaultsPaths () |
| static ApplicationPtr | getInstance () |
| Retrieve shared pointer to the application object. | |
| static const Ice::StringSeq & | GetProjectDependencies () |
| static const std::string & | GetProjectName () |
| static std::string | GetVersion () |
| static void | LoadDefaultConfig (Ice::PropertiesPtr properties) |
| static void | setInstance (ApplicationPtr const &inst) |
Static Public Attributes | |
| static const std::string | ArmarXUserConfigDirEnvVar = "ARMARX_CONFIG_DIR" |
Protected Member Functions | |
| PropertyDefinitionsPtr | createPropertyDefinitions () override |
| int | doMain (int argc, char *argv[], const Ice::InitializationData &initData, Ice::Int i) override |
| Ice::Application::doMain() is called by Ice::Application::main() and does setup of Ice::Communicator before calling the virtual Ice::Application::run() method. | |
| virtual int | exec (const ArmarXManagerPtr &armarXManager) |
| Exec method is the main process of the application. | |
| ArmarXManagerPtr | getArmarXManager () |
| virtual std::string | getDomainName () |
| Retrieve the domain name used for property parsing. | |
| void | loadDefaultConfig (int argc, char *argv[], const Ice::InitializationData &initData) |
| void | loadDependentProjectDatapaths () |
| Ice::PropertiesPtr | parseOptionsMergeProperties (int argc, char *argv[]) |
| Parse options given on the commandline and merge them into the regular properties. | |
| virtual void | setup (const ManagedIceObjectRegistryInterfacePtr ®istry, Ice::PropertiesPtr properties)=0 |
| Setup method to be implemented by user applications. | |
| void | showHelp (ApplicationOptions::Options &options) |
| Print help onto the screen or into a file. | |
Static Protected Member Functions | |
| static void | HandlerFault (int sig) |
| handlerFault handles signals sendt to the application such as SIGSEGF or SIGABRT (Linux) | |
| static void | HandlerInterrupt (int sig) |
| handlerInterrupt handles interrupt signals sent to the application (Linux) | |
Baseclass for all ArmarX applications.
Implements the run method from the Ice::Application interface which is called by the automatically generated main.cpp. In order to start writing an ArmarX application, inherit from armarx::Application and implement the setup method to setup and add the required ManagedIceObjects.
The application automatically loads a default config file (usually ~/.armarx/default.cfg), which is needed to connect to IceGrid etc. This function is also available as a static version: LoadDefaultConfig()
If you only want to use one component (as above), you can use runSimpleComponentApp. In this case, your main function would look like this:
If you are using the defaults for ApplicationType (Application) ExampleComponentConfigName (getDefaultName()) and ExampleComponentDomain ("ArmarX"), your main function looks like this:
Application specific configuration files can be passed to the application by using the Ice.Config commandline parameter. The used configuration file format is those of regular Ice configuration files.
Each entry in Ice configuration files is prefixed with a "DomainName" which is "ArmarX" by default. This "DomainName" can be changed by overriding armarx::Application::getDomainName() to return a different string.
Sometimes it is not possible to pass configuration files via the Ice.Config parameter (e.g. when using IceGrid XML deployment files where this paramter is overriden by IceGrid). In this case, the commandline parameter ArmarX.Config can be used. All files specified in this parameter will be merged into the standard properties available inside the armarx::Application.
Special properties:
Internally, an armarx::Application contains an armarx::ArmarXManger which is responsible for managing they lifecycle of all components inside an application.
Definition at line 193 of file Application.h.
| Application | ( | ) |
Application initalizes the Ice::Application base class.
Definition at line 311 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Creates the one application instance of type T.
T is usually the type of a sublass as defined in a specific component. This method is called from the automatically generated main.cpp.
Definition at line 210 of file Application.h.
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Implements PropertyUser.
Reimplemented in ArmarXGuiApp, and SimulatorViewerApp.
Definition at line 895 of file Application.cpp.
Here is the call graph for this function:
|
overrideprotected |
Ice::Application::doMain() is called by Ice::Application::main() and does setup of Ice::Communicator before calling the virtual Ice::Application::run() method.
| argc | |
| argv | |
| initData |
Definition at line 781 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void enableLibLoading | ( | bool | enable = true | ) |
Definition at line 278 of file Application.cpp.
|
protectedvirtual |
Exec method is the main process of the application.
The default implementation only calls
armarXManager->waitForShutdown();
If you need to do something in the main process (e.g. processing QT guis) overwrite this method.
Reimplemented in ArmarXGuiApp, ScenarioCli, and SimulatorViewerApp.
Definition at line 555 of file Application.cpp.
Here is the caller graph for this function:
|
static |
|
protected |
Definition at line 775 of file Application.cpp.
Here is the caller graph for this function:| std::vector< std::string > getArmarXPackageNames | ( | ) |
getDefaultPackageNames returns the value of the ArmarX.DefaultPackages property It splits the string by , and returns the elements as a vector.
Definition at line 694 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| const std::vector< std::string > & getCommandLineArguments | ( | ) | const |
Definition at line 296 of file Application.cpp.
|
static |
Definition at line 826 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedvirtual |
Retrieve the domain name used for property parsing.
Overwrite this in your subclass in order to use another domain name then "ArmarX". The domain name is the first part of the property identifier where each part is separated via a "." (e.g. ArmarX.some.property).
Reimplemented in MemoryXApplication, and VisionXApplication.
Definition at line 625 of file Application.cpp.
Here is the caller graph for this function:| bool getForbidThreadCreation | ( | ) | const |
Definition at line 256 of file Application.cpp.
|
static |
Retrieve shared pointer to the application object.
Use this in order to access is called from the automatically generated main.cpp.
Definition at line 316 of file Application.cpp.
Here is the caller graph for this function:| std::string getName | ( | ) | const |
Retrieve name of the application.
Definition at line 637 of file Application.cpp.
Here is the caller graph for this function:
|
static |
|
static |
| const ThreadPoolPtr & getThreadPool | ( | ) | const |
Definition at line 380 of file Application.cpp.
|
inlinestatic |
|
staticprotected |
handlerFault handles signals sendt to the application such as SIGSEGF or SIGABRT (Linux)
| sig |
Definition at line 109 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
handlerInterrupt handles interrupt signals sent to the application (Linux)
| sig |
Definition at line 302 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
This method is called when new Properties are set via setIceProperties().
Each class deriving from PropertyUser can overwrite this method in order to react to changed properties.
Reimplemented from PropertyUser.
Definition at line 356 of file Application.cpp.
Here is the call graph for this function:
|
override |
Cleans up connections with IceStorm before terminating the app.
| signal | The signal send to the application |
Definition at line 643 of file Application.cpp.
Here is the caller graph for this function:| bool isPackageAutoDiscoveryEnabled | ( | ) |
Definition at line 680 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 853 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 847 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 901 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Parse options given on the commandline and merge them into the regular properties.
Definition at line 563 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void registerDataPathsFromDependencies | ( | std::string | dependencies | ) |
|
override |
Ice::Application replacement for the main function.
Definition at line 386 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setForbidThreadCreation | ( | bool | value | ) |
Definition at line 262 of file Application.cpp.
|
overridevirtual |
Overrides PropertyUser::setIceProperties() which is called internally.
Additionally it calls Component::updateIceProperties().
Reimplemented from PropertyUser.
Definition at line 332 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| void setName | ( | const std::string & | name | ) |
Set name of the application.
Called from main.cpp. This method has an effect only if it is called before Application::main()
| application | name |
Definition at line 631 of file Application.cpp.
Here is the caller graph for this function:
|
protectedpure virtual |
Setup method to be implemented by user applications.
Use this method to add all required ManagedIceObject to the application
Implemented in ArmarXGuiApp, DecoupledSingleComponentApp, DummyApplication, MultipleComponentsApplication, ScenarioCli, and SimulatorViewerApp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Print help onto the screen or into a file.
Definition at line 594 of file Application.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void storeCommandLineArguments | ( | int | argc, |
| char * | argv[] ) |
Definition at line 284 of file Application.cpp.
|
override |
|
static |
Definition at line 297 of file Application.h.