31 template<
class ObjectType>
37 return obr_.foundObject<ObjectType>(fieldName);
41 template<
class ObjectType>
47 return obr_.lookupObject<ObjectType>(fieldName);
51 template<
class ObjectType>
57 return obr_.lookupObjectRef<ObjectType>(fieldName);
61 template<
class ObjectType>
69 if (cacheable && fieldName == tfield().
name())
72 <<
"Cannot store cache-able field with the name used in the cache." 74 <<
" Either choose a different name or cache the field" 75 <<
" and use the 'writeObjects' functionObject." 84 && obr_.foundObject<ObjectType>(fieldName)
87 ObjectType& field = obr_.lookupObjectRef<ObjectType>(fieldName);
92 if (&field != &tfield())
98 obr_.objectRegistry::store(tfield.
ptr());
103 if (fieldName.size() && fieldName != tfield().name())
105 tfield.
ref().rename(fieldName);
109 fieldName = tfield().name();
112 obr_.objectRegistry::store(tfield.
ptr());
T & ref() const
Return non-const reference or generate a fatal error.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const ObjectType & lookupObject(const word &fieldName) const
Lookup object from the objectRegistry.
A class for handling words, derived from string.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the given field in the objectRegistry under the given name.
bool foundObject(const word &fieldName) const
Find field in the objectRegistry.
word name(const complex &)
Return a string representation of a complex.
#define WarningInFunction
Report a warning using Foam::Warning.
ObjectType & lookupObjectRef(const word &fieldName)
Lookup non-const object reference from the objectRegistry.
T * ptr() const
Return tmp pointer for reuse.
A class for managing temporary objects.