| 87 | } |
| 88 | |
| 89 | bool DataStorageService::AddDataStorage(const std::string& label, DataStorage::Pointer storage) |
| 90 | { |
| 91 | if (label.empty() || storage.IsNull()) |
| 92 | { |
| 93 | return false; |
| 94 | } |
| 95 | |
| 96 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 97 | |
| 98 | // Check for duplicate label |
| 99 | if (label == DEFAULT_LABEL || this->FindStorageByLabel(label).IsValid()) |
| 100 | { |
| 101 | return false; |
| 102 | } |
| 103 | |
| 104 | m_Storages.emplace_back(label, storage); |
| 105 | return true; |
| 106 | } |
| 107 | |
| 108 | std::optional<DataStorageReference> DataStorageService::CreateDataStorage(const std::string& label) |
| 109 | { |