IceProperties::InheritanceSolver Class Reference

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

+ Inheritance diagram for IceProperties::InheritanceSolver:

Public Types

using NamespaceMap = std::map< std::string, bool >
 

Public Member Functions

void extractNamespaces (const Ice::PropertiesPtr &properties, NamespaceMap &namespaces)
 Extracts all existing namespace within the passed property container. More...
 
std::string getParent (const std::string &childNamespace, const Ice::PropertiesPtr &properties)
 Returns the parent namespace of a child namespace. More...
 
bool hasParent (const std::string &childNamespace, const Ice::PropertiesPtr &properties)
 Checks whether the specified namespace has a parent which it inherits from. More...
 
void inherit (const std::string &childNamespace, const std::string &parentNamespace, Ice::PropertiesPtr &properties, std::vector< std::string > heritageLine)
 Performs the inheritance of properties from parentNamespace to childNamespace. More...
 
bool isInHeritageLine (const std::vector< std::string > &heritageLine, const std::string &namespace_)
 Checks whether the specified namespace exists already in the heritageLine. More...
 
void resolveInheritance (Ice::PropertiesPtr &properties)
 Resolves all inheritance specifications made using the config notation "<namespace>.inheritFrom = <namespace>" while <namespace> is <domain>. More...
 
void resolveNamespaceInheritance (const std::string &childNamespace, Ice::PropertiesPtr &properties)
 Resolves namespace inheritance for a specific namespace. More...
 
std::string stripNamespace (const std::string &propertyName, const std::string &namespace_)
 Removes the namespace of the property name. More...
 
 ~InheritanceSolver () override
 

Detailed Description

Definition at line 210 of file IceProperties.h.

Member Typedef Documentation

◆ NamespaceMap

using NamespaceMap = std::map<std::string, bool>

Definition at line 214 of file IceProperties.h.

Constructor & Destructor Documentation

◆ ~InheritanceSolver()

~InheritanceSolver ( )
override

Definition at line 223 of file IceProperties.cpp.

Member Function Documentation

◆ extractNamespaces()

void extractNamespaces ( const Ice::PropertiesPtr properties,
NamespaceMap namespaces 
)

Extracts all existing namespace within the passed property container.

More simply it extracts all existing prefixes.

Parameters
[in]propertiesInput property container
[out]namespacesExtracted properties

Definition at line 244 of file IceProperties.cpp.

◆ getParent()

std::string getParent ( const std::string &  childNamespace,
const Ice::PropertiesPtr properties 
)

Returns the parent namespace of a child namespace.

Parameters
[in]childNamespaceChild namespace.
[in]propertiesInput properties containing inheritance specifications.
Returns
parent namespace, otherwise an empty string

Definition at line 280 of file IceProperties.cpp.

◆ hasParent()

bool hasParent ( const std::string &  childNamespace,
const Ice::PropertiesPtr properties 
)

Checks whether the specified namespace has a parent which it inherits from.

The inheritance is specified via a property as follows: <childNamespace>.inheritFrom = <parentNamespace>.

<childNamespace> can be anything. Usually it consists of the <domain> and <object-name>.

Parameters
[in]childNamespaceChild namespace.
[in]propertiesInput properties containing inheritance specifications.

Definition at line 266 of file IceProperties.cpp.

◆ inherit()

void inherit ( const std::string &  childNamespace,
const std::string &  parentNamespace,
Ice::PropertiesPtr properties,
std::vector< std::string >  heritageLine 
)

Performs the inheritance of properties from parentNamespace to childNamespace.

Parameters
[in]childNamespaceNamespace requiring inheritance
[in]parentNamespaceParent namespace to inherit from.
propertiesInput and output properties
heritageLineHeritage line vector. This is used to detect inheritance cycles.

Definition at line 323 of file IceProperties.cpp.

◆ isInHeritageLine()

bool isInHeritageLine ( const std::vector< std::string > &  heritageLine,
const std::string &  namespace_ 
)

Checks whether the specified namespace exists already in the heritageLine.

Parameters
[in]heritageLineHeritage line vector
[in]namespaceThe namespace to look for
Returns
true if namespace is in heritageLine, otherwise false

Definition at line 288 of file IceProperties.cpp.

◆ resolveInheritance()

void resolveInheritance ( Ice::PropertiesPtr properties)

Resolves all inheritance specifications made using the config notation "<namespace>.inheritFrom = <namespace>" while <namespace> is <domain>.

<object-name>.

Parameters
propertiesThe properties with inheritance specifications. The resolved inheritance is done within this property contain as well.

Definition at line 228 of file IceProperties.cpp.

◆ resolveNamespaceInheritance()

void resolveNamespaceInheritance ( const std::string &  childNamespace,
Ice::PropertiesPtr properties 
)

Resolves namespace inheritance for a specific namespace.

This will resolve all inheritance specifications of it's parent namespace.

Parameters
[in]childNamespaceNamespace requiring inheritance
propertiesInput and output properties

Definition at line 312 of file IceProperties.cpp.

◆ stripNamespace()

std::string stripNamespace ( const std::string &  propertyName,
const std::string &  namespace_ 
)

Removes the namespace of the property name.

"<namespace>.<property-name> = <propertyValue>" becomes "<property-name> = <property-value>".

Returns
property name without the namespace.

Definition at line 306 of file IceProperties.cpp.


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