| 42 | } |
| 43 | |
| 44 | WasmResult SharedData::get(std::string_view vm_id, const std::string_view key, |
| 45 | std::pair<std::string, uint32_t> *result) { |
| 46 | std::lock_guard<std::mutex> lock(mutex_); |
| 47 | auto map = data_.find(std::string(vm_id)); |
| 48 | if (map == data_.end()) { |
| 49 | return WasmResult::NotFound; |
| 50 | } |
| 51 | auto it = map->second.find(std::string(key)); |
| 52 | if (it != map->second.end()) { |
| 53 | *result = it->second; |
| 54 | return WasmResult::Ok; |
| 55 | } |
| 56 | return WasmResult::NotFound; |
| 57 | } |
| 58 | |
| 59 | WasmResult SharedData::keys(std::string_view vm_id, std::vector<std::string> *result) { |
| 60 | result->clear(); |
no test coverage detected