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

Method SafeRemove

core/include/safe_object_manager.hpp:112–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 static bool SafeRemove(const std::string& name)
113 {
114 auto manager = SimpleObjectManager<M, T>::GetInstance();
115
116 manager->Lock();
117
118 auto ir = (*manager).begin();
119 auto end = (*manager).end();
120
121 while(ir != end)
122 {
123 if(ir->first == name)
124 {
125 SimpleObjectManager<M, T>::FreeObject(ir->second);
126 manager->erase(ir);
127
128 manager->Unlock();
129 return true;
130 }
131
132 ir++;
133 }
134
135 manager->Unlock();
136 return false;
137 }
138
139 static bool SafeRemoveOnly(const std::string& name)
140 {

Callers

nothing calls this directly

Calls 4

beginMethod · 0.80
endMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected