MCPcopy Create free account
hub / github.com/OAID/Tengine / SafeGet

Method SafeGet

core/include/safe_object_manager.hpp:53–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 static bool SafeGet(const std::string& name, T& val)
54 {
55 auto manager = SimpleObjectManager<M, T>::GetInstance();
56 bool ret = true;
57
58 manager->Lock();
59
60 if(manager->count(name))
61 val = (*manager)[name];
62 else
63 ret = false;
64
65 manager->Unlock();
66
67 return ret;
68 }
69
70 static bool SafeAdd(const std::string& name, const T& data)
71 {

Callers

nothing calls this directly

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected