MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / checkOut

Function checkOut

src/OpenFOAM/db/objectRegistry/objectRegistry.C:233–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231
232
233bool Foam::objectRegistry::checkOut(regIOobject& io) const
234{
235 iterator iter = const_cast<objectRegistry&>(*this).find(io.name());
236
237 if (iter != end())
238 {
239 if (objectRegistry::debug)
240 {
241 Pout<< "objectRegistry::checkOut(regIOobject&) : "
242 << name() << " : checking out " << iter.key()
243 << endl;
244 }
245
246 if (iter() != &io)
247 {
248 if (objectRegistry::debug)
249 {
250 WarningInFunction
251 << name() << " : attempt to checkOut copy of "
252 << iter.key()
253 << endl;
254 }
255
256 return false;
257 }
258 else
259 {
260 regIOobject* object = iter();
261
262 bool hasErased = const_cast<objectRegistry&>(*this).erase(iter);
263
264 if (io.ownedByRegistry())
265 {
266 delete object;
267 }
268
269 return hasErased;
270 }
271 }
272 else
273 {
274 if (objectRegistry::debug)
275 {
276 Pout<< "objectRegistry::checkOut(regIOobject&) : "
277 << name() << " : could not find " << io.name()
278 << " in registry " << name()
279 << endl;
280 }
281 }
282
283 return false;
284}
285
286
287void Foam::objectRegistry::rename(const word& newName)

Callers 1

objectRegistry.CFile · 0.70

Calls 6

eraseMethod · 0.80
ownedByRegistryMethod · 0.80
endFunction · 0.50
nameFunction · 0.50
nameMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected