MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getModuleInfo

Method getModuleInfo

tsn/src/tsn/tsn.cpp:94–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 std::optional<ModuleInfo> getModuleInfo(std::string_view moduleName) {
95 std::lock_guard<Valdi::Mutex> lock(_mutex);
96 if (!_pendingModules.empty()) {
97 _registeredModules.reserve(_registeredModules.size() + _pendingModules.size());
98
99 for (const auto& it : _pendingModules) {
100 auto& inserted = _registeredModules[std::string_view(it.moduleName)];
101 inserted.name = it.moduleName;
102 inserted.sha256 = it.sha256;
103 inserted.moduleInitFn = it.moduleInitFn;
104 }
105 }
106
107 const auto& it = _registeredModules.find(moduleName);
108 if (it == _registeredModules.end()) {
109 return std::nullopt;
110 }
111
112 return it->second;
113 }
114
115 static ModuleRegistry& getInstance() {
116 static auto* kInstance = new ModuleRegistry();

Callers 1

tsn_get_module_infoFunction · 0.80

Calls 5

endMethod · 0.65
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected