Go to the documentation of this file.
34 template<
class ObjectType>
44 template<
class ObjectType>
54 template<
class ObjectType>
60 return obr().
findObject<ObjectType>(fieldName);
64 template<
class ObjectType>
75 template<
class ObjectType>
85 template<
class ObjectType>
95 template<
class ObjectType>
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 ObjectType* fieldptr;
130 && (fieldptr = getObjectPtr<ObjectType>(fieldName)) !=
nullptr
136 if (fieldptr != &tfield())
138 (*fieldptr) = tfield;
142 obr().objectRegistry::store(tfield.
ptr());
147 if (fieldName.size() && fieldName != tfield().name())
149 tfield.
ref().rename(fieldName);
153 fieldName = tfield().name();
156 obr().objectRegistry::store(tfield.
ptr());
163 template<
class ObjectType>
166 const word& fieldName,
171 ObjectType* fieldptr;
175 && (fieldptr = obr.
getObjectPtr<ObjectType>(fieldName)) != nullptr
178 (*fieldptr) = tfield;
182 tfield.
ref().rename(fieldName);
183 obr.objectRegistry::store(tfield.
ptr());
Type * getObjectPtr(const word &name, const bool recursive=false) const
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.
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
const ObjectType * cfindObject(const word &fieldName) const
Registry of regIOobjects.
bool foundObject(const word &fieldName) const
Find object (eg, a field) in the (sub) objectRegistry.
const Type & lookupObject(const word &name, const bool recursive=false) const
const ObjectType * findObject(const word &fieldName) const
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
Type & lookupObjectRef(const word &name, const bool recursive=false) const
ObjectType * getObjectPtr(const word &fieldName) const
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
bool storeInDb(const word &fieldName, const tmp< ObjectType > &tfield, const objectRegistry &obr)
Store the field in an optional objectRegistry under the given name.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define WarningInFunction
Report a warning using Foam::Warning.