31 template<
class ObjectType>
37 return obr_.foundObject<ObjectType>(fieldName);
41 template<
class ObjectType>
47 return obr_.lookupObject<ObjectType>(fieldName);
51 template<
class ObjectType>
59 if (cacheable && fieldName == tfield().
name())
62 <<
"Cannot store cache-able field with the named used in the cache." 64 <<
" Either choose a different name or cache the field" 65 <<
" and use the 'writeObjects' functionObject." 74 && obr_.foundObject<ObjectType>(fieldName)
77 const ObjectType& field =
79 obr_.lookupObject<ObjectType>(fieldName)
85 if (&field != &tfield())
87 const_cast<ObjectType&
>(field) = tfield;
91 obr_.objectRegistry::store(tfield.
ptr());
96 if (fieldName.size() && fieldName != tfield().name())
98 tfield.
ref().rename(fieldName);
102 fieldName = tfield().name();
105 obr_.objectRegistry::store(tfield.
ptr());
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool foundObject(const word &fieldName) const
Find field in 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.
T * ptr() const
Return tmp pointer for reuse.
word name(const complex &)
Return a string representation of a complex.
#define WarningInFunction
Report a warning using Foam::Warning.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
const ObjectType & lookupObject(const word &fieldName) const
Lookup field from the objectRegistry.