| 159 | } |
| 160 | |
| 161 | void NodeUidMapper::RestoreUid(const DataNode* node, const std::string& uid) |
| 162 | { |
| 163 | if (node == nullptr) |
| 164 | { |
| 165 | throw std::invalid_argument("Node cannot be null"); |
| 166 | } |
| 167 | |
| 168 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 169 | |
| 170 | // Restore the mapping in both directions |
| 171 | m_UidToNode[uid] = const_cast<DataNode*>(node); |
| 172 | m_NodeToUid[node] = uid; |
| 173 | |
| 174 | // Restore as property for debugging visibility |
| 175 | const_cast<DataNode*>(node)->SetStringProperty(UID_PROPERTY_KEY, uid.c_str()); |
| 176 | } |
| 177 | |
| 178 | std::string NodeUidMapper::GenerateUid() |
| 179 | { |