#include <freIDPath.h>


Public Types | |
| enum | PathElementType { PTNULL = 0, PTSelf = 1, PTParent = 2, PTAnyChild = 3, PTAnyDescendant = 4, PTComponent = 5, PTParameter = 6, PTMedia = 7 } |
Public Member Functions | |
| bool | IsEmpty () const |
| bool | IsAbsolute () const |
| bool | IsRoot () const |
| void | SetAbsolute (const bool &bAbsolute) |
| bool | IsParameterSelection () const |
| bool | IsMediaSelection () const |
| bool | IsComponentSelection () const |
| unsigned int | Size () const |
| unsigned int | AddComponent (const PathElementType &elementType, const std::string &sTag) |
| PathElementType | GetComponent (const unsigned int &index, std::string &sTag) const |
| PathElementType | GetFirstComponent (std::string &sTag) const |
| IDPath | GetSubIDPath () const |
| IDPath | GetParentIDPath () const |
| IDPath | GetParentComponentIDPath () const |
| IDPath | GetParameterIDPath () const |
| std::string | GetParameterName () const |
| std::string | GetMediaID () const |
| std::string | GetComponentID () const |
| IDPath | TransformIDPath (const IDPath &origin) const |
| operator std::string () const | |
| std::string | ToStr () const |
| bool | operator== (const IDPath &path) const |
| bool | Equals (const IDPath &path) const |
| bool | ChildOf (const IDPath &path) const |
| IDPath & | operator= (const IDPath &path) |
| IDPath & | operator= (const std::string &path) |
| IDPath & | operator= (const char *path) |
| IDPath | operator+ (const IDPath &modPath) const |
| IDPath () | |
| IDPath (const IDPath &path) | |
| IDPath (const std::string &path) | |
| IDPath (const char *path) | |
| ~IDPath () | |
| virtual void | Reset () |
Static Public Member Functions | |
| static IDPath | Concat (const IDPath &path1, const IDPath &path2) |
| static IDPath | Parameter (const std::string &sParameterName, unsigned long lValueID=0, unsigned long lLayerID=0) |
| static IDPath | Media (const std::string &sMediaName) |
Protected Types | |
| enum | TokenType { TTSlash = 0, TTDot = 1, TTDDot = 2, TTWildcard = 3, TTDSlash = 4, TTComponent = 5 } |
| typedef std::vector < PathElementType > | PathElementTypeVector |
Protected Member Functions | |
| virtual void | SubElementLoadProcessing (const std::string &rsXMLSubTag, const std::string &rsXMLSubElement, const std::string &rsXMLSubData) |
| virtual std::string | SaveData (const unsigned int &iDepth, bool &bHasSubElements) const |
| IDPath | AssembleIDPath (const unsigned int &iFirstID, const unsigned int &iLastID) const |
Static Protected Member Functions | |
| static bool | IDPathesMatch (const IDPath &left, const IDPath &right) |
| static bool | GetFirstToken (const std::string &sIDPath, TokenType &token, std::string &sFirstTag, std::string &sSubPath) |
| static PathElementType | GetComponentType (const std::string &sTokenTag, std::string &sComponentID) |
Protected Attributes | |
| PathElementTypeVector | m_ElementTypes |
| STLStringVector | m_ElementTags |
| bool | m_bAbsolute |
IDPath defines components within a setup using the component ids. IDPath can be considered as XPath light. The basic syntax is the same, also the meaning of the token. The only difference is that you do not declare xml tokens within the path, but the component ids. The available XPath expressions are:
Definition at line 48 of file freIDPath.h.
typedef std::vector<PathElementType> FREE::IDPath::PathElementTypeVector [protected] |
Definition at line 247 of file freIDPath.h.
Specifies the different element types of an IDPath.
Definition at line 52 of file freIDPath.h.
enum FREE::IDPath::TokenType [protected] |
Specifies the different types of tokens, that can appear in an IDPath.
Definition at line 219 of file freIDPath.h.
| FREE::IDPath::IDPath | ( | ) |
Definition at line 371 of file freIDPath.cxx.
References Reset().

| FREE::IDPath::IDPath | ( | const IDPath & | path | ) |
Definition at line 377 of file freIDPath.cxx.
| FREE::IDPath::IDPath | ( | const std::string & | path | ) |
Definition at line 383 of file freIDPath.cxx.
| FREE::IDPath::IDPath | ( | const char * | path | ) |
Definition at line 389 of file freIDPath.cxx.
| FREE::IDPath::~IDPath | ( | ) |
Definition at line 395 of file freIDPath.cxx.
| bool FREE::IDPath::IsEmpty | ( | ) | const [inline] |
Returns if the IDPath is empty.
Definition at line 65 of file freIDPath.h.
References m_ElementTypes.
Referenced by FREE::ComponentSetupBrowser::CrawlComponentByIDPath(), FREE::DispatchParameterIDPath(), FREE::AccuracySOMetricThread< VImageDimension >::EvaluateField(), FREE::AccuracySOMetricThread< VImageDimension >::EvaluatePoints(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), GetParentComponentIDPath(), IDPathesMatch(), IsRoot(), FREE::ImageDifferenceSOMetricThread< VImageDimension >::ProcessSetup(), FREE::ImageClassificationSOMetricThread< VImageDimension >::ProcessSetup(), and FREE::ComponentMediaLink::SaveData().
| bool FREE::IDPath::IsAbsolute | ( | ) | const [inline] |
Returns if the path is absolute or relative to an other IDPath.
Definition at line 67 of file freIDPath.h.
References m_bAbsolute.
Referenced by FREE::GenericSetupToImageAdaptor::AdaptSetup(), FREE::ComponentSetupBrowser::CrawlComponentByIDPath(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), IsRoot(), operator+(), and operator=().
| bool FREE::IDPath::IsRoot | ( | ) | const [inline] |
Returns if the path is a root (hence it is absolute and empty).
Definition at line 69 of file freIDPath.h.
References IsAbsolute(), and IsEmpty().

| void FREE::IDPath::SetAbsolute | ( | const bool & | bAbsolute | ) | [inline] |
Definition at line 71 of file freIDPath.h.
References m_bAbsolute.
Referenced by AssembleIDPath(), FREE::ComponentSetupBrowser::CrawlComponentByIDPath(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), GetParentIDPath(), Media(), operator=(), and Parameter().
| bool FREE::IDPath::IsParameterSelection | ( | ) | const |
Returns if the IDPath selectes a paramter of the component.
Definition at line 30 of file freIDPath.cxx.
References m_ElementTypes, and PTParameter.
Referenced by FREE::SessionAccessor::GetParameterByIDPath(), FREE::SessionAccessor::GetValidityTag(), FREE::SessionAccessor::GetValidityTagRequirement(), IsComponentSelection(), and FREE::SessionAccessor::SetParameterValueByIDPath().
| bool FREE::IDPath::IsMediaSelection | ( | ) | const |
Returns if the IDPath selectes a medium of the component.
Definition at line 44 of file freIDPath.cxx.
References m_ElementTypes, and PTMedia.
Referenced by FREE::SessionAccessor::GetMedia(), FREE::SessionAccessor::GetMediaControllerID(), FREE::SessionAccessor::GetValidityTag(), FREE::SessionAccessor::GetValidityTagRequirement(), IsComponentSelection(), and FREE::SessionAccessor::SetMedia().
| bool FREE::IDPath::IsComponentSelection | ( | ) | const |
Returns if the IDPath selectes only a component.
Definition at line 58 of file freIDPath.cxx.
References IsMediaSelection(), and IsParameterSelection().
Referenced by GetParentComponentIDPath().

| unsigned int FREE::IDPath::Size | ( | ) | const [inline] |
Number of path elements the IDPath contains.
Definition at line 65 of file freIDPath.cxx.
References m_ElementTypes.
Referenced by AssembleIDPath(), Concat(), GetComponent(), GetParameterIDPath(), GetParentIDPath(), GetSubIDPath(), operator=(), and ToStr().
| unsigned int FREE::IDPath::AddComponent | ( | const PathElementType & | elementType, | |
| const std::string & | sTag | |||
| ) |
Adds a new element to the end of the path.
Definition at line 72 of file freIDPath.cxx.
References m_ElementTags, and m_ElementTypes.
Referenced by AssembleIDPath(), Concat(), Media(), operator=(), and Parameter().
| IDPath::PathElementType FREE::IDPath::GetComponent | ( | const unsigned int & | index, | |
| std::string & | sTag | |||
| ) | const |
Function returns the path element type of the component specified by the index within the IDPath and also passes the tag of the path element.
| [in] | index | Index of the component whose tag and type should be retrieved. |
| [out] | sTag | The specified component name of the IDPath, excluding a following slash. |
Definition at line 81 of file freIDPath.cxx.
References m_ElementTags, m_ElementTypes, PTNULL, and Size().
Referenced by AssembleIDPath(), ChildOf(), Concat(), FREE::DispatchParameterIDPath(), GetFirstComponent(), and operator=().

| IDPath::PathElementType FREE::IDPath::GetFirstComponent | ( | std::string & | sTag | ) | const |
Function returns the path element type of the first component within the IDPath and also passes the tag of the path element.
| [out] | sTag | The first component of the IDPath, excluding a following slash. |
Definition at line 96 of file freIDPath.cxx.
References GetComponent().
Referenced by FREE::ComponentSetupBrowser::CrawlComponentByIDPath(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), IDPathesMatch(), and operator+().

| IDPath FREE::IDPath::GetSubIDPath | ( | ) | const |
Function returns the IDPath without the first component and the seperating slash.
Definition at line 104 of file freIDPath.cxx.
References AssembleIDPath(), and Size().
Referenced by FREE::ComponentSetupBrowser::CrawlComponentByIDPath(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), IDPathesMatch(), and operator+().

| IDPath FREE::IDPath::GetParentIDPath | ( | ) | const |
Function returns the IDPath of the preceeding element, so without the last path element.
Definition at line 112 of file freIDPath.cxx.
References AssembleIDPath(), SetAbsolute(), and Size().
Referenced by GetParentComponentIDPath(), and operator+().

| IDPath FREE::IDPath::GetParentComponentIDPath | ( | ) | const |
Function returns the IDPath of the the first preceeding element that is a component, neither a parameter nor a media component.
Definition at line 121 of file freIDPath.cxx.
References GetParentIDPath(), IsComponentSelection(), and IsEmpty().
Referenced by FREE::SessionAccessor::GetMedia(), FREE::SetupTransform::GetParameterValueType(), and FREE::SessionAccessor::SetMedia().

| IDPath FREE::IDPath::GetParameterIDPath | ( | ) | const |
Function returns the IDPath of the parameter, so the parameter element will be the relative root of the parameter path.
e.g.: /item1/subitem//1 -> /1
If no parameter is selected in this path, the returned path will be empty.
Definition at line 135 of file freIDPath.cxx.
References AssembleIDPath(), m_ElementTypes, PTParameter, and Size().
Referenced by FREE::DispatchParameterIDPath().

| std::string FREE::IDPath::GetParameterName | ( | ) | const |
Function returns the parameter name, if one is specified by the path.
Definition at line 157 of file freIDPath.cxx.
References m_ElementTags, m_ElementTypes, and PTParameter.
Referenced by FREE::SetupTransform::GetParameterValueType(), FREE::SessionAccessor::GetValidityTag(), and FREE::SessionAccessor::GetValidityTagRequirement().
| std::string FREE::IDPath::GetMediaID | ( | ) | const |
Function returns the media id, if one is specified by the path.
Definition at line 171 of file freIDPath.cxx.
References m_ElementTags, m_ElementTypes, and PTMedia.
Referenced by FREE::SessionAccessor::GetMedia(), FREE::SessionAccessor::GetMediaControllerID(), FREE::SessionAccessor::GetValidityTag(), FREE::SessionAccessor::GetValidityTagRequirement(), and FREE::SessionAccessor::SetMedia().
| std::string FREE::IDPath::GetComponentID | ( | ) | const |
Function returns the component ID of the last component of the path, if one is specified by the path.
Definition at line 185 of file freIDPath.cxx.
References m_ElementTags, m_ElementTypes, and PTComponent.
Referenced by FREE::Adaptation::AdaptationComponent::AttributesLoadProcessing(), and FREE::Adaptation::AdaptationComponent::operator=().
This function transforms the ID path relative to the passed origin. If this is a relative path it will be attached to origin and all . and .. tokens at the beginning will be processed. If this is an absolute path the return is independent from the origin and will be the value of this.
Example:
this: ../Item2/Child3
origin: /Main/Item1
Result: /Main/Item2/Child3
| [in] | origin | the actual path for relative path transformations. |
Definition at line 328 of file freIDPath.cxx.
| FREE::IDPath::operator std::string | ( | ) | const [inline] |
Definition at line 146 of file freIDPath.h.
References ToStr().

| std::string FREE::IDPath::ToStr | ( | ) | const |
Definition at line 199 of file freIDPath.cxx.
References m_ElementTags, m_ElementTypes, PTAnyChild, PTAnyDescendant, PTComponent, PTMedia, PTParameter, PTParent, PTSelf, and Size().
Referenced by FREE::WarpImageFilterControllerBase< FREE::ImageTypes< 3 >::InternalImageType, FREE::ImageTypes< 3 >::TransformationFieldType >::ActualizeMainComponent(), FREE::ResampleImageFilterControllerBase< FREE::ImageTypes< 2 >::InternalImageType >::ActualizeMainComponent(), FREE::MediaActualizer::ActualizeMediaByField(), FREE::MediaActualizer::ActualizeMediaByFunction(), FREE::SessionBuilder::BuildComponent(), FREE::DispatchParameterIDPath(), Equals(), FREE::AccuracySOMetricThread< VImageDimension >::EvaluateField(), FREE::AccuracySOMetricThread< VImageDimension >::EvaluatePoints(), FREE::ITKTransformControllerBase< TITKTransform, VDimension >::GenerateInverseTransformationFunction(), FREE::ITKTransformControllerBase< TITKTransform, VDimension >::GenerateTransformationFunction(), FREE::ComponentSetup::GetComponentByIDPath(), FREE::SessionComponentCache::GetConstCacheByIDPath(), FREE::SessionAccessor::GetLinkedMedia(), FREE::SessionAccessor::GetMedia(), FREE::ComponentControllerBase< TControlledComponent >::GetMediaCasted(), FREE::SessionAccessor::GetMediaControllerID(), FREE::SessionAccessor::GetParameterByIDPath(), FREE::SessionAccessor::GetParameterValue(), FREE::SessionAccessor::GetParameterValueByIDPath(), FREE::SetupTransform::GetParameterValueType(), FREE::TransformFunctionAccessor< TTransformBase >::GetTransformControllerAndCache(), FREE::SessionAccessor::GetValidityTag(), FREE::SessionAccessor::GetValidityTagRequirement(), FREE::SetupManager::InitializeComponentSetup(), FREE::SessionBuilder::LinkMediaToComponent(), FREE::SessionBuilder::LinkMediaToComponentByID(), operator std::string(), FREE::ImageDifferenceSOMetricThread< VImageDimension >::ProcessSetup(), FREE::ImageClassificationSOMetricThread< VImageDimension >::ProcessSetup(), FREE::Adaptation::AdaptationComponent::SaveAttributes(), SaveData(), FREE::PointSetMediaControllerBase< PixelType, 2 >::SaveMedia(), FREE::ComponentSetupBrowser::SearchForComponents(), FREE::RegistrationProcessEventHandler< TRegistrationProcessor >::SetComponentCache(), FREE::SessionAccessor::SetMedia(), FREE::ComponentControllerBase< TControlledComponent >::SetMediaCasted(), FREE::AccuracySOMetric< VImageDimension >::SetMovingPointsPath(), FREE::SessionAccessor::SetParameterValueByIDPath(), FREE::AccuracySOMetric< VImageDimension >::SetReferenceFieldPath(), FREE::ImageDifferenceSOMetric< VImageDimension >::SetReferenceImagePath(), FREE::ImageClassificationSOMetric< VImageDimension >::SetReferenceImagePath(), FREE::AccuracySOMetric< VImageDimension >::SetReferencePointsPath(), FREE::PrecisionSOMetric< VImageDimension >::SetResultFieldPath(), FREE::AccuracySOMetric< VImageDimension >::SetResultFieldPath(), FREE::ImageDifferenceSOMetric< VImageDimension >::SetResultImagePath(), FREE::ImageClassificationSOMetric< VImageDimension >::SetResultImagePath(), and FREE::SetupOptimizationProcessorController::SetStatisticEntrySubComponents().

| bool FREE::IDPath::operator== | ( | const IDPath & | path | ) | const |
Checks if to IDPathes are specify the same element. Hence all wildcards will be processed.
E.G.: "item1/child1/grandChild2" == ".//item1//grandChild2" is true
Definition at line 231 of file freIDPath.cxx.
References IDPathesMatch().
Referenced by ChildOf().

| bool FREE::IDPath::Equals | ( | const IDPath & | path | ) | const |
Compares to IDPathes for real equality. So its a string compare of their string conversion
Definition at line 238 of file freIDPath.cxx.
References ToStr().

| bool FREE::IDPath::ChildOf | ( | const IDPath & | path | ) | const |
Compares if this is a child of the passed IDPath.
Definition at line 245 of file freIDPath.cxx.
References GetComponent(), operator==(), PTAnyChild, PTMedia, PTNULL, and PTParameter.

Definition at line 263 of file freIDPath.cxx.
References AddComponent(), GetComponent(), IsAbsolute(), m_bAbsolute, Reset(), and Size().

| IDPath & FREE::IDPath::operator= | ( | const std::string & | path | ) |
Definition at line 283 of file freIDPath.cxx.
References AddComponent(), GetComponentType(), GetFirstToken(), Reset(), SetAbsolute(), TTComponent, and TTSlash.

| IDPath & FREE::IDPath::operator= | ( | const char * | path | ) |
Definition at line 319 of file freIDPath.cxx.
This funcion concates to ID pathes together.
The passed path will be handled as selction modifier for the actual path. Hence the type of the IDPath will influence the way of concatination:
| [in] | path | The IDPath to be added. |
Definition at line 335 of file freIDPath.cxx.
References Concat(), GetFirstComponent(), GetParentIDPath(), GetSubIDPath(), IsAbsolute(), PTParent, and PTSelf.

Concanates two pathes without path processing.
Definition at line 358 of file freIDPath.cxx.
References AddComponent(), GetComponent(), and Size().
Referenced by operator+().

| void FREE::IDPath::Reset | ( | ) | [virtual] |
Resets the object to default/initial state
Reimplemented from FREE::XMLStreamObject.
Definition at line 399 of file freIDPath.cxx.
References m_bAbsolute, m_ElementTags, and m_ElementTypes.
Referenced by FREE::AccuracySOMetric< VImageDimension >::AccuracySOMetric(), FREE::AccuracySOMetricThread< VImageDimension >::AccuracySOMetricThread(), IDPath(), FREE::ImageClassificationSOMetric< VImageDimension >::ImageClassificationSOMetric(), FREE::ImageClassificationSOMetricThread< VImageDimension >::ImageClassificationSOMetricThread(), FREE::ImageDifferenceSOMetric< VImageDimension >::ImageDifferenceSOMetric(), FREE::ImageDifferenceSOMetricThread< VImageDimension >::ImageDifferenceSOMetricThread(), operator=(), and FREE::ComponentMediaLink::Reset().
| IDPath FREE::IDPath::Parameter | ( | const std::string & | sParameterName, | |
| unsigned long | lValueID = 0, |
|||
| unsigned long | lLayerID = 0 | |||
| ) | [static] |
Static function that generates a relative IDPath of the specified parameter.
E.g.: Parameter("Param1",0,1) will result in the path "@Param1/0/1".
| [in] | sParameterName | Name of the parameter |
| [in] | lValueID | ID/position of the value (Default is 0) |
| [in] | lLayerID | Layer of the value (Default is 0) |
Definition at line 562 of file freIDPath.cxx.
References AddComponent(), PTComponent, PTParameter, SetAbsolute(), and FREE::Convert::ToStr().
Referenced by FREE::EvolutionaryStrategySOOptimizerController::ActualizeMainComponent().

| IDPath FREE::IDPath::Media | ( | const std::string & | sMediaName | ) | [static] |
Static function that generates a relative IDPath of the specified media
| [in] | sMediaName | Name of the media |
Definition at line 583 of file freIDPath.cxx.
References AddComponent(), PTMedia, and SetAbsolute().

| void FREE::IDPath::SubElementLoadProcessing | ( | const std::string & | rsXMLSubTag, | |
| const std::string & | rsXMLSubElement, | |||
| const std::string & | rsXMLSubData | |||
| ) | [protected, virtual] |
| std::string FREE::IDPath::SaveData | ( | const unsigned int & | iDepth, | |
| bool & | bHasSubElements | |||
| ) | const [protected, virtual] |
Reimplemented from FREE::XMLStreamObject.
Definition at line 415 of file freIDPath.cxx.
References ToStr().

| IDPath FREE::IDPath::AssembleIDPath | ( | const unsigned int & | iFirstID, | |
| const unsigned int & | iLastID | |||
| ) | const [protected] |
Function assambles an IDPath out of the actual IDPath, by starting with the element specified by firstID and concatenates all components untill the lastId is reached.
| [in] | iFirstID | ID of the first component in the new IDPath. |
| [in] | iLastID | ID of the last component that should be encluded in the new IDPath. |
Definition at line 423 of file freIDPath.cxx.
References AddComponent(), GetComponent(), SetAbsolute(), and Size().
Referenced by GetParameterIDPath(), GetParentIDPath(), and GetSubIDPath().

Definition at line 446 of file freIDPath.cxx.
References GetFirstComponent(), GetSubIDPath(), IsEmpty(), PTAnyChild, and PTAnyDescendant.
Referenced by operator==().

| bool FREE::IDPath::GetFirstToken | ( | const std::string & | sIDPath, | |
| TokenType & | token, | |||
| std::string & | sFirstTag, | |||
| std::string & | sSubPath | |||
| ) | [static, protected] |
Function returns the token type of the first component within the IDPath and also passes the string by sFirstComponent.
| [in] | sIDPath | The IDPath which should be parsed. |
| [out] | sFirstTag | The first component tag of the IDPath, excluding a following slash. |
| [out] | sSubPath | Rest of the parsed path. |
| [out] | token | Token type of the first token. |
Definition at line 491 of file freIDPath.cxx.
References TTComponent, TTDDot, TTDot, TTDSlash, TTSlash, and TTWildcard.
Referenced by operator=().
| IDPath::PathElementType FREE::IDPath::GetComponentType | ( | const std::string & | sTokenTag, | |
| std::string & | sComponentID | |||
| ) | [static, protected] |
Checkes if the passed component token is a component, an attribute or a media definition. returns the corresponding path element type and the plain ID of the component (without the axes declarators @ or #)
| [in] | sTokenFlag | the whole string tag of the token. |
| [out] | sComponentID | the ID of t |
Definition at line 520 of file freIDPath.cxx.
References PTComponent, PTMedia, PTParameter, and throwStaticExceptionMacro.
Referenced by operator=().
PathElementTypeVector FREE::IDPath::m_ElementTypes [protected] |
Definition at line 249 of file freIDPath.h.
Referenced by AddComponent(), GetComponent(), GetComponentID(), GetMediaID(), GetParameterIDPath(), GetParameterName(), IsEmpty(), IsMediaSelection(), IsParameterSelection(), Reset(), Size(), and ToStr().
STLStringVector FREE::IDPath::m_ElementTags [protected] |
Definition at line 250 of file freIDPath.h.
Referenced by AddComponent(), GetComponent(), GetComponentID(), GetMediaID(), GetParameterName(), Reset(), and ToStr().
bool FREE::IDPath::m_bAbsolute [protected] |
Indicates if the IDPath is absolute or relative.
Definition at line 253 of file freIDPath.h.
Referenced by IsAbsolute(), operator=(), Reset(), and SetAbsolute().
1.5.3 written by Dimitri van Heesch,
© 1997-2000