IceProperties stores ice properties and resolves property inheritance. More...

#include <ArmarXCore/core/application/properties/IceProperties.h>

+ Inheritance diagram for IceProperties:

Classes

class  InheritanceSolver
 

Public Types

using InheritanceSolverPtr = IceUtil::Handle< InheritanceSolver >
 

Public Member Functions

::Ice::PropertiesPtr clone () ICE_NOEXCEPT override
 
::Ice::StringSeq getCommandLineOptions () ICE_NOEXCEPT override
 
virtual InheritanceSolverPtr getInheritanceSolver ()
 Returns the currently used inheritance solver. More...
 
::Ice::PropertyDict getPropertiesForPrefix (const ::std::string &prefix) ICE_NOEXCEPT override
 
::std::string getProperty (const ::std::string &name) ICE_NOEXCEPT override
 
::Ice::Int getPropertyAsInt (const ::std::string &name) ICE_NOEXCEPT override
 
::Ice::Int getPropertyAsIntWithDefault (const ::std::string &name, ::Ice::Int defaultValue) ICE_NOEXCEPT override
 
::Ice::StringSeq getPropertyAsList (const ::std::string &name) ICE_NOEXCEPT override
 
::Ice::StringSeq getPropertyAsListWithDefault (const ::std::string &name, const ::Ice::StringSeq &defaultValue) ICE_NOEXCEPT override
 
::std::string getPropertyWithDefault (const ::std::string &name, const ::std::string &defaultValue) ICE_NOEXCEPT override
 
 IceProperties (const Ice::PropertiesPtr iceProperties)
 Ice property container constructor. More...
 
 IceProperties (const IceProperties &source)
 
void load (const ::std::string &fileName) override
 
::Ice::StringSeq parseCommandLineOptions (const ::std::string &prefix, const ::Ice::StringSeq &options) override
 
::Ice::StringSeq parseIceCommandLineOptions (const ::Ice::StringSeq &options) override
 
virtual void setInheritanceSolver (const InheritanceSolverPtr &inheritanceSolver)
 Sets an inheritance solver in case of testing or using a non-default solver. More...
 
void setProperty (const ::std::string &name, const ::std::string &value) override
 
 ~IceProperties () override
 Ice property container desctructor. More...
 

Static Public Member Functions

static Ice::PropertiesPtr create (const Ice::PropertiesPtr &iceProperties=nullptr)
 
static Ice::PropertiesPtr create (Ice::StringSeq &propertySeq, const Ice::PropertiesPtr &iceProperties=nullptr)
 
static Ice::PropertiesPtr create (int &argn, char *argv[], const Ice::PropertiesPtr &iceProperties=nullptr)
 

Detailed Description

IceProperties stores ice properties and resolves property inheritance.

This Ice property container supports inheritance. That is, a namespace can inherit all properties defined within another namespace. Inherited properties can also be overridden if redefined.

Additionally, there exists a stringreplacement namespace "Variables", which can be used to define variables that will be searched in the property values of namespaces that inherit from the "Variables" namespace. In case a property has a matching string, this string is replaced with the value of the global variable.

<namespace>.inheritFrom = <namespace>

Example config:

ArmarX.CommonProperties.FrameRate = 30
ArmarX.CommonProperties.ColorMode = HSV
ArmarX.CommonProperties.ShutterSpeed = 0.003
ArmarX.CommonProperties.Aperture = 1.2
ArmarX.CommonProperties.WhiteBalance = Auto
ArmarX.CommonProperties.Metering = CenteredMean
ArmarX.CommonProperties.Resolution = 640x480
ArmarX.CommonProperties.CropFactor = 1.5
Variables.Prefix = Local
VisionX.MyCapturer1.inheritFrom = ArmarX.CommonProperties
VisionX.MyCapturer1.inheritFrom = Variables
VisionX.MyCapturer1.ColorMode = RGB
VisionX.MyCapturer1.ObjectName = {Prefix}_MyCapturer1
VisionX.MyCapturer2.inheritFrom = ArmarX.CommonProperties
VisionX.MyCapturer2.ShutterSpeed = 0.001
VisionX.MyCapturer3.FrameRate = 60
VisionX.MyCapturer3.inheritFrom = ArmarX.CommonProperties

The result is:

ArmarX.CommonProperties.FrameRate = 30
...
...
ArmarX.CommonProperties.CropFactor = 1.5
VisionX.MyCapturer1.FrameRate = 30
VisionX.MyCapturer1.ColorMode = RGB
VisionX.MyCapturer1.ShutterSpeed = 0.003
VisionX.MyCapturer1.Aperture = 1.2
VisionX.MyCapturer1.WhiteBalance = Auto
VisionX.MyCapturer1.Metering = CenteredMean
VisionX.MyCapturer1.Resolution = 640x480
VisionX.MyCapturer1.CropFactor = 1.5
VisionX.MyCapturer1.ObjectName = Local_MyCapturer1
VisionX.MyCapturer2.FrameRate = 30
VisionX.MyCapturer2.ColorMode = HSV
VisionX.MyCapturer2.ShutterSpeed = 0.001
VisionX.MyCapturer2.Aperture = 1.2
VisionX.MyCapturer2.WhiteBalance = Auto
VisionX.MyCapturer2.Metering = CenteredMean
VisionX.MyCapturer2.Resolution = 640x480
VisionX.MyCapturer2.CropFactor = 1.5
VisionX.MyCapturer3.FrameRate = 60
VisionX.MyCapturer3.ColorMode = HSV
VisionX.MyCapturer3.ShutterSpeed = 0.003
VisionX.MyCapturer3.Aperture = 1.2
VisionX.MyCapturer3.WhiteBalance = Auto
VisionX.MyCapturer3.Metering = CenteredMean
VisionX.MyCapturer3.Resolution = 640x480
VisionX.MyCapturer3.CropFactor = 1.5

Definition at line 120 of file IceProperties.h.

Member Typedef Documentation

◆ InheritanceSolverPtr

Constructor & Destructor Documentation

◆ IceProperties() [1/2]

IceProperties ( const Ice::PropertiesPtr  iceProperties)
explicit

Ice property container constructor.

Definition at line 67 of file IceProperties.cpp.

+ Here is the caller graph for this function:

◆ IceProperties() [2/2]

IceProperties ( const IceProperties source)

Definition at line 74 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ ~IceProperties()

~IceProperties ( )
override

Ice property container desctructor.

Definition at line 85 of file IceProperties.cpp.

Member Function Documentation

◆ clone()

Ice::PropertiesPtr clone ( )
override
See also
Ice::Properties::clone()

Definition at line 183 of file IceProperties.cpp.

◆ create() [1/3]

Ice::PropertiesPtr create ( const Ice::PropertiesPtr iceProperties = nullptr)
static

Definition at line 32 of file IceProperties.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create() [2/3]

Ice::PropertiesPtr create ( Ice::StringSeq &  propertySeq,
const Ice::PropertiesPtr iceProperties = nullptr 
)
static

Definition at line 39 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ create() [3/3]

Ice::PropertiesPtr create ( int &  argn,
char *  argv[],
const Ice::PropertiesPtr iceProperties = nullptr 
)
static

Definition at line 51 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getCommandLineOptions()

Ice::StringSeq getCommandLineOptions ( )
override
See also
Ice::Properties::getCommandLineOptions()

Definition at line 148 of file IceProperties.cpp.

◆ getInheritanceSolver()

IceProperties::InheritanceSolverPtr getInheritanceSolver ( )
virtual

Returns the currently used inheritance solver.

Returns
inheritance solver pointer

Definition at line 212 of file IceProperties.cpp.

◆ getPropertiesForPrefix()

Ice::PropertyDict getPropertiesForPrefix ( const ::std::string &  prefix)
override
See also
Ice::Properties::getPropertiesForPrefix()

Definition at line 135 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getProperty()

std::string getProperty ( const ::std::string &  name)
override
See also
Ice::Properties::getProperty()

Definition at line 90 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getPropertyAsInt()

Ice::Int getPropertyAsInt ( const ::std::string &  name)
override
See also
Ice::Properties::getPropertyAsInt()

Definition at line 105 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getPropertyAsIntWithDefault()

Ice::Int getPropertyAsIntWithDefault ( const ::std::string &  name,
::Ice::Int  defaultValue 
)
override
See also
Ice::Properties::getPropertyAsIntWithDefault()

Definition at line 112 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getPropertyAsList()

Ice::StringSeq getPropertyAsList ( const ::std::string &  name)
override
See also
Ice::Properties::getPropertyAsList()

Definition at line 120 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getPropertyAsListWithDefault()

Ice::StringSeq getPropertyAsListWithDefault ( const ::std::string &  name,
const ::Ice::StringSeq &  defaultValue 
)
override
See also
Ice::Properties::getPropertyAsListWithDefault()

Definition at line 127 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ getPropertyWithDefault()

std::string getPropertyWithDefault ( const ::std::string &  name,
const ::std::string &  defaultValue 
)
override
See also
Ice::Properties::getPropertyWithDefault()

Definition at line 97 of file IceProperties.cpp.

+ Here is the call graph for this function:

◆ load()

void load ( const ::std::string &  fileName)
override
See also
Ice::Properties::load()

Definition at line 176 of file IceProperties.cpp.

◆ parseCommandLineOptions()

Ice::StringSeq parseCommandLineOptions ( const ::std::string &  prefix,
const ::Ice::StringSeq &  options 
)
override
See also
Ice::Properties::parseCommandLineOptions()

Definition at line 155 of file IceProperties.cpp.

◆ parseIceCommandLineOptions()

Ice::StringSeq parseIceCommandLineOptions ( const ::Ice::StringSeq &  options)
override
See also
Ice::Properties::parseIceCommandLineOptions()

Definition at line 166 of file IceProperties.cpp.

◆ setInheritanceSolver()

void setInheritanceSolver ( const InheritanceSolverPtr inheritanceSolver)
virtual

Sets an inheritance solver in case of testing or using a non-default solver.

Definition at line 217 of file IceProperties.cpp.

+ Here is the caller graph for this function:

◆ setProperty()

void setProperty ( const ::std::string &  name,
const ::std::string &  value 
)
override
See also
Ice::Properties::setProperty()

Definition at line 142 of file IceProperties.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files:
VisionX
This file is part of ArmarX.