MCPcopy Create free account
hub / github.com/MITK/MITK / GetPropertyKeysForScope

Function GetPropertyKeysForScope

Modules/RESTAPI/src/mitkDataStorageBridge.cpp:104–133  ·  view source on GitHub ↗

* @brief Get the correct set of property keys for a given scope. * * Uses IPropertyProvider::GetPropertyKeys() which returns only keys owned by * the respective provider (no fall-through from node to data or vice versa). * * @pre node must not be nullptr. */

Source from the content-addressed store, hash-verified

102 * @pre node must not be nullptr.
103 */
104 std::vector<std::string> GetPropertyKeysForScope(
105 const mitk::DataNode* node,
106 const std::string& contextName,
107 mitk::PropertyScope scope)
108 {
109 // Get data-level keys (needed for Data and All scopes)
110 std::vector<std::string> dataKeys;
111 if (scope != mitk::PropertyScope::Node && node->GetData() != nullptr)
112 {
113 dataKeys = node->GetData()->GetPropertyKeys(contextName);
114 }
115
116 if (scope == mitk::PropertyScope::Data)
117 return dataKeys;
118
119 auto nodeKeys = node->GetPropertyKeys(contextName);
120
121 if (scope == mitk::PropertyScope::Node)
122 return nodeKeys;
123
124 // Scope::All — union of node + data keys
125 if (!dataKeys.empty())
126 {
127 std::set<std::string> allKeySet(nodeKeys.begin(), nodeKeys.end());
128 allKeySet.insert(dataKeys.begin(), dataKeys.end());
129 return std::vector<std::string>(allKeySet.begin(), allKeySet.end());
130 }
131
132 return nodeKeys;
133 }
134
135 std::string GenerateTimestampString()
136 {

Callers 2

GetNodePropertiesMethod · 0.85
ReplaceNodePropertiesMethod · 0.85

Calls 5

GetDataMethod · 0.45
GetPropertyKeysMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected