|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Class that can be used to specify nested or wild carded property keys. E.g. for the use in context of the property persistence service or the property relation service.
Following assumptions are made /preconditions are defined:
More...
#include <mitkPropertyKeyPath.h>

Classes | |
| struct | NodeInfo |
| Information about a single node in a PropertyKeyPath. More... | |
Public Types | |
| using | ItemSelectionIndex = std::size_t |
| using | ElementNameType = std::string |
| using | NodeInfoVectorType = std::vector< NodeInfo > |
| using | PathIndexType = NodeInfoVectorType::size_type |
Public Member Functions | |
| bool | IsEmpty () const |
| bool | IsExplicit () const |
| bool | HasItemSelectionWildcardsOnly () const |
| PathIndexType | GetSize () const |
| PathIndexType | AddNode (const NodeInfo &newNode) |
| const NodeInfo & | GetNode (const PathIndexType &index) const |
| NodeInfo & | GetNode (const PathIndexType &index) |
| NodeInfo & | GetFirstNode () |
| const NodeInfo & | GetFirstNode () const |
| NodeInfo & | GetLastNode () |
| const NodeInfo & | GetLastNode () const |
| const NodeInfoVectorType & | GetNodes () const |
| Get a const reference to all node info entries. More... | |
| bool | operator== (const PropertyKeyPath &path) const |
| Compare two PropertyKeyPaths for exact structural equality. More... | |
| bool | operator< (const PropertyKeyPath &right) const |
| Lexicographic less-than comparison. More... | |
| bool | operator<= (const PropertyKeyPath &right) const |
| Lexicographic less-than-or-equal comparison. More... | |
| bool | operator>= (const PropertyKeyPath &right) const |
| Lexicographic greater-than-or-equal comparison. More... | |
| bool | operator> (const PropertyKeyPath &right) const |
| Lexicographic greater-than comparison. More... | |
| bool | Equals (const PropertyKeyPath &path) const |
| Check if two PropertyKeyPaths match, processing wildcards. More... | |
| PropertyKeyPath & | operator= (const PropertyKeyPath &path) |
| Assignment operator. More... | |
| PropertyKeyPath & | AddAnyElement () |
| Append a wildcard "any element" node to the path. More... | |
| PropertyKeyPath & | AddElement (const ElementNameType &name) |
| Append a named element node to the path. More... | |
| PropertyKeyPath & | AddAnySelection (const ElementNameType &name) |
| Append a named element with wildcard selection to the path. More... | |
| PropertyKeyPath & | AddSelection (const ElementNameType &name, ItemSelectionIndex index) |
| Append a named element with a specific selection index to the path. More... | |
| PropertyKeyPath () | |
| Default constructor. Creates an empty path. More... | |
| PropertyKeyPath (const PropertyKeyPath &path) | |
| Copy constructor. More... | |
| PropertyKeyPath (const std::initializer_list< ElementNameType > &list) | |
| Construct a path from a list of element names. More... | |
| ~PropertyKeyPath () | |
| void | Reset () |
| Clear the path, removing all nodes. More... | |
Static Protected Member Functions | |
| static bool | PropertyKeyPathsMatch (const PropertyKeyPath &left, const PropertyKeyPath &right) |
Protected Attributes | |
| NodeInfoVectorType | m_NodeInfos |
Class that can be used to specify nested or wild carded property keys. E.g. for the use in context of the property persistence service or the property relation service.
Following assumptions are made /preconditions are defined:
Selections are used to indicate that the preceding element has multiple occurrences and which occurrence is meant. Example property keys would be:
To build a path one may use the Add* method to build up the PropertyKeyPath element by element.
"first.*.third.[3]" would be equivalent to propKeyPath.AddElement("first"); propKeyPath.AddAnyElement(); propKeyPath.AddSelection("third",3);
or the inline version propKeyPath.AddElement("first").AddAnyElement().AddSelection("third",3);
Definition at line 54 of file mitkPropertyKeyPath.h.
| using mitk::PropertyKeyPath::ElementNameType = std::string |
Definition at line 58 of file mitkPropertyKeyPath.h.
| using mitk::PropertyKeyPath::ItemSelectionIndex = std::size_t |
Definition at line 57 of file mitkPropertyKeyPath.h.
| using mitk::PropertyKeyPath::NodeInfoVectorType = std::vector<NodeInfo> |
Definition at line 118 of file mitkPropertyKeyPath.h.
| using mitk::PropertyKeyPath::PathIndexType = NodeInfoVectorType::size_type |
Definition at line 119 of file mitkPropertyKeyPath.h.
| mitk::PropertyKeyPath::PropertyKeyPath | ( | ) |
Default constructor. Creates an empty path.
| mitk::PropertyKeyPath::PropertyKeyPath | ( | const PropertyKeyPath & | path | ) |
Copy constructor.
| [in] | path | The path to copy. |
| mitk::PropertyKeyPath::PropertyKeyPath | ( | const std::initializer_list< ElementNameType > & | list | ) |
Construct a path from a list of element names.
Creates a simple key path consisting only of Element nodes.
| [in] | list | An initializer list of element name strings. |
| mitk::PropertyKeyPath::~PropertyKeyPath | ( | ) |
| PropertyKeyPath& mitk::PropertyKeyPath::AddAnyElement | ( | ) |
Append a wildcard "any element" node to the path.
The resulting node matches any element name and selection.
| PropertyKeyPath& mitk::PropertyKeyPath::AddAnySelection | ( | const ElementNameType & | name | ) |
Append a named element with wildcard selection to the path.
The resulting node matches any selection index for the given element name.
| [in] | name | The element name. |
| PropertyKeyPath& mitk::PropertyKeyPath::AddElement | ( | const ElementNameType & | name | ) |
Append a named element node to the path.
| [in] | name | The element name. |
| PathIndexType mitk::PropertyKeyPath::AddNode | ( | const NodeInfo & | newNode | ) |
Adds a new node to the end of the path.
| [in] | newNode | Reference to the node that should be added. |
| PropertyKeyPath& mitk::PropertyKeyPath::AddSelection | ( | const ElementNameType & | name, |
| ItemSelectionIndex | index | ||
| ) |
Append a named element with a specific selection index to the path.
| [in] | name | The element name. |
| [in] | index | The selection index. |
| bool mitk::PropertyKeyPath::Equals | ( | const PropertyKeyPath & | path | ) | const |
Check if two PropertyKeyPaths match, processing wildcards.
Unlike operator==(), this method treats wildcards as matching any corresponding node. For example, "item1.child1.grandChild2" matches "item1.*.grandChild2".
| [in] | path | The path to compare against. |
true if the paths match (considering wildcards).| NodeInfo& mitk::PropertyKeyPath::GetFirstNode | ( | ) |
Function returns the node info of the first path node within the PropertyKeyPath.
| const NodeInfo& mitk::PropertyKeyPath::GetFirstNode | ( | ) | const |
Function returns the node info of the first path node within the PropertyKeyPath.
| NodeInfo& mitk::PropertyKeyPath::GetLastNode | ( | ) |
Function returns the node info of the last path node within the PropertyKeyPath.
| const NodeInfo& mitk::PropertyKeyPath::GetLastNode | ( | ) | const |
Function returns the node info of the last path node within the PropertyKeyPath.
| NodeInfo& mitk::PropertyKeyPath::GetNode | ( | const PathIndexType & | index | ) |
Function returns the node info of a path node specified by the index within the PropertyKeyPath.
| [in] | index | Index of the node whose info should be retrieved. |
| const NodeInfo& mitk::PropertyKeyPath::GetNode | ( | const PathIndexType & | index | ) | const |
Function returns the node info of a path node specified by the index within the PropertyKeyPath.
| [in] | index | Index of the node whose info should be retrieved. |
| const NodeInfoVectorType& mitk::PropertyKeyPath::GetNodes | ( | ) | const |
Get a const reference to all node info entries.
| PathIndexType mitk::PropertyKeyPath::GetSize | ( | ) | const |
Number of path nodes the PropertyKeyPath contains.
| bool mitk::PropertyKeyPath::HasItemSelectionWildcardsOnly | ( | ) | const |
Returns if the path has any nodes with item selection wild cards ([*]).
| bool mitk::PropertyKeyPath::IsEmpty | ( | ) | const |
Returns if the PropertyKeyPath is empty.
| bool mitk::PropertyKeyPath::IsExplicit | ( | ) | const |
Returns if the path is explicit (has no wildcards).
| bool mitk::PropertyKeyPath::operator< | ( | const PropertyKeyPath & | right | ) | const |
Lexicographic less-than comparison.
Compares node names, types, and selections element by element.
| [in] | right | The path to compare against. |
true if this path is lexicographically less than right. | bool mitk::PropertyKeyPath::operator<= | ( | const PropertyKeyPath & | right | ) | const |
Lexicographic less-than-or-equal comparison.
| [in] | right | The path to compare against. |
true if this path is lexicographically less than or equal to right. | PropertyKeyPath& mitk::PropertyKeyPath::operator= | ( | const PropertyKeyPath & | path | ) |
Assignment operator.
| [in] | path | The path to copy from. |
| bool mitk::PropertyKeyPath::operator== | ( | const PropertyKeyPath & | path | ) | const |
Compare two PropertyKeyPaths for exact structural equality.
Two paths are equal if and only if all their nodes are identical (same type, name, and selection index).
| [in] | path | The path to compare against. |
true if both paths are structurally identical.| bool mitk::PropertyKeyPath::operator> | ( | const PropertyKeyPath & | right | ) | const |
Lexicographic greater-than comparison.
| [in] | right | The path to compare against. |
true if this path is lexicographically greater than right. | bool mitk::PropertyKeyPath::operator>= | ( | const PropertyKeyPath & | right | ) | const |
Lexicographic greater-than-or-equal comparison.
| [in] | right | The path to compare against. |
true if this path is lexicographically greater than or equal to right.
|
staticprotected |
| void mitk::PropertyKeyPath::Reset | ( | ) |
Clear the path, removing all nodes.
|
protected |
Definition at line 311 of file mitkPropertyKeyPath.h.