Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
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 |
Public Types | |
using | ItemSelectionIndex = std::size_t |
using | ElementNameType = std::string |
using | NodeInfoVectorType = std::vector< NodeInfo > |
using | PathIndexType = NodeInfoVectorType::size_type |
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 51 of file mitkPropertyKeyPath.h.
using mitk::PropertyKeyPath::ElementNameType = std::string |
Definition at line 55 of file mitkPropertyKeyPath.h.
using mitk::PropertyKeyPath::ItemSelectionIndex = std::size_t |
Definition at line 54 of file mitkPropertyKeyPath.h.
using mitk::PropertyKeyPath::NodeInfoVectorType = std::vector<NodeInfo> |
Definition at line 79 of file mitkPropertyKeyPath.h.
using mitk::PropertyKeyPath::PathIndexType = NodeInfoVectorType::size_type |
Definition at line 80 of file mitkPropertyKeyPath.h.
mitk::PropertyKeyPath::PropertyKeyPath | ( | ) |
mitk::PropertyKeyPath::PropertyKeyPath | ( | const PropertyKeyPath & | path | ) |
mitk::PropertyKeyPath::PropertyKeyPath | ( | const std::initializer_list< ElementNameType > & | list | ) |
overload constructor that supports simple key paths consisting only of elements.
mitk::PropertyKeyPath::~PropertyKeyPath | ( | ) |
PropertyKeyPath& mitk::PropertyKeyPath::AddAnyElement | ( | ) |
Appends an "any element" to the path instance.
PropertyKeyPath& mitk::PropertyKeyPath::AddAnySelection | ( | const ElementNameType & | name | ) |
Appends an element with the passed name and any selection to the path instance.
PropertyKeyPath& mitk::PropertyKeyPath::AddElement | ( | const ElementNameType & | name | ) |
Appends an element with the passed name to the path instance.
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 | ||
) |
Appends an element with the passed name and selection index to the path instance.
bool mitk::PropertyKeyPath::Equals | ( | const PropertyKeyPath & | path | ) | const |
Checks if two PropertyKeyPaths specify the same node. Hence all wildcards will be processed.
E.G.: "item1.child1.grandChild2" == "item1.*.grandChild2" is true.
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 |
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 |
Operation equals like comparing the ToStr() results with operator <.
bool mitk::PropertyKeyPath::operator<= | ( | const PropertyKeyPath & | right | ) | const |
Operation equals like comparing the ToStr() results with operator <=.
PropertyKeyPath& mitk::PropertyKeyPath::operator= | ( | const PropertyKeyPath & | path | ) |
bool mitk::PropertyKeyPath::operator== | ( | const PropertyKeyPath & | path | ) | const |
Compares two PropertyKeyPaths for real equality. So it is a string comparison of their string conversion.
bool mitk::PropertyKeyPath::operator> | ( | const PropertyKeyPath & | right | ) | const |
Operation equals like comparing the ToStr() results with operator >.
bool mitk::PropertyKeyPath::operator>= | ( | const PropertyKeyPath & | right | ) | const |
Operation equals like comparing the ToStr() results with operator >=.
|
staticprotected |
void mitk::PropertyKeyPath::Reset | ( | ) |
|
protected |
Definition at line 179 of file mitkPropertyKeyPath.h.