| 18 | } |
| 19 | |
| 20 | void EnumMap::Refresh(const pmapi::intro::Root& introRoot) |
| 21 | { |
| 22 | using ::pmon::util::str::ToWide; |
| 23 | auto& singleton = Get_(); |
| 24 | std::lock_guard lk{ singleton.mtx_ }; |
| 25 | for (auto e : introRoot.GetEnums()) { |
| 26 | auto pKeys = std::make_shared<KeyMap>(); auto& keys = *pKeys; |
| 27 | for (auto k : e.GetKeys()) { |
| 28 | keys[k.GetId()] = { |
| 29 | .narrowSymbol = k.GetSymbol(), |
| 30 | .wideSymbol = ToWide(k.GetSymbol()), |
| 31 | .narrowName = k.GetName(), |
| 32 | .wideName = ToWide(k.GetName()), |
| 33 | .narrowShortName = k.GetShortName(), |
| 34 | .wideShortName = ToWide(k.GetShortName()), |
| 35 | .narrowDescription = k.GetDescription(), |
| 36 | .wideDescription = ToWide(k.GetDescription()), |
| 37 | }; |
| 38 | } |
| 39 | singleton.enumMap_[e.GetId()] = std::move(pKeys); |
| 40 | } |
| 41 | singleton.initialized_ = true; |
| 42 | } |
| 43 | |
| 44 | bool EnumMap::Initialized() |
| 45 | { |
nothing calls this directly
no test coverage detected