Go to the documentation of this file.
34 template<
class ObjectType>
40 return obr().foundObject<ObjectType>(fieldName);
44 template<
class ObjectType>
50 return obr().cfindObject<ObjectType>(fieldName);
54 template<
class ObjectType>
60 return obr().findObject<ObjectType>(fieldName);
64 template<
class ObjectType>
71 return obr().getObjectPtr<ObjectType>(fieldName);
75 template<
class ObjectType>
81 return obr().getObjectPtr<ObjectType>(fieldName);
85 template<
class ObjectType>
91 return obr().lookupObject<ObjectType>(fieldName);
95 template<
class ObjectType>
101 return obr().lookupObjectRef<ObjectType>(fieldName);
105 template<
class ObjectType>
113 if (cacheable && fieldName == tfield().
name())
116 <<
"Cannot store cache-able field with the name used in the cache."
118 <<
" Either choose a different name or cache the field"
119 <<
" and use the 'writeObjects' functionObject."
125 if (fieldName.size() && foundObject<ObjectType>(fieldName))
127 const ObjectType&
field = lookupObject<ObjectType>(fieldName);
132 if (&
field != &tfield())
134 const_cast<ObjectType&
>(
field) = tfield;
138 obr().objectRegistry::store(tfield.
ptr());
143 if (fieldName.size() && fieldName != tfield().name())
145 tfield.
ref().rename(fieldName);
149 fieldName = tfield().name();
152 obr().objectRegistry::store(tfield.
ptr());
A class for handling words, derived from Foam::string.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
A class for managing temporary objects.
ObjectType & lookupObjectRef(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
const ObjectType * cfindObject(const word &fieldName) const
bool foundObject(const word &fieldName) const
Find object (eg, a field) in the (sub) objectRegistry.
word name(const complex &c)
Return string representation of complex.
const ObjectType * findObject(const word &fieldName) const
ObjectType * getObjectPtr(const word &fieldName) const
#define WarningInFunction
Report a warning using Foam::Warning.