|
| | 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 |
| |
| 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 |
| |
Baseclass for all ArmarX applications.
- helper class for ArmarX main programs
- creates an instance of ArmarXManager
- generates properties from commandline parameters
- provides help and automatic generation of properties
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.
class ExampleApp :
{
{
};
}
Baseclass for all ArmarX applications.
Definition Application.h:194
virtual void setup(const ManagedIceObjectRegistryInterfacePtr ®istry, Ice::PropertiesPtr properties)=0
Setup method to be implemented by user applications.
static TPtr create(Ice::PropertiesPtr properties=Ice::createProperties(), const std::string &configName="", const std::string &configDomain="ArmarX")
Factory method for a component.
Definition Component.h:116
::IceInternal::Handle<::Ice::Properties > PropertiesPtr
Definition PropertyDefinition.h:50
IceUtil::Handle< ManagedIceObjectRegistryInterface > ManagedIceObjectRegistryInterfacePtr
Definition Application.h:83
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:
int main(
int argc,
char* argv[])
{
}
int main()
Definition UnscentedKalmanFilterTest.cpp:175
int runSimpleComponentApp(int argc, char *argv[], std::string appName, const std::string &configName="", const std::string &configDomain="ArmarX", bool enableLibLoading=false)
Creates and runs an application (of AppT) for the given component (ComponentT).
Definition Application.h:494
If you are using the defaults for ApplicationType (Application) ExampleComponentConfigName (getDefaultName()) and ExampleComponentDomain ("ArmarX"), your main function looks like this:
int main(
int argc,
char* argv[])
{
}
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:
- ArmarX.Config
- ArmarX.NetworkStats: set to "1" to enable logging of network statistics (use armarx::ProfilerObserver to collect the data)
- ArmarX.DependenciesConfig
- ArmarX.ProjectDatapath
- ArmarX.ProjectName
- ArmarX.ProjectDependencies
- <DomainName>.DisableLogging
- <DomainName>.Verbosity
- <DomainName>.DataPath
Internally, an armarx::Application contains an armarx::ArmarXManger which is responsible for managing they lifecycle of all components inside an application.