36 #ifndef OldTimeField_H
37 #define OldTimeField_H
48 template<
class FieldType>
56 template<
class FieldType>
61 template<
class,
class,
template<
class>
class>
class GeoField,
64 template<class> class PrimitiveField
68 typedef GeoField<Type, GeoMesh, PrimitiveField>
type;
79 template<
class,
class,
template<
class>
class>
class GeoField,
85 typedef GeoField<Type, GeoMesh, Field>
type;
93 template<
class FieldType>
98 template<
class,
class,
template<
class>
class>
class GeoField,
101 template<class> class PrimitiveField
105 template<
template<
class>
class OtherPrimitiveField>
106 using type = GeoField<Type, GeoMesh, OtherPrimitiveField>;
114 template<
class FieldType>
125 template<
template<
class>
class OtherPrimitiveField>
126 using OtherFieldType =
128 template type<OtherPrimitiveField>;
134 template<
template<
class>
class OtherPrimitiveField>
142 mutable label timeIndex_;
151 const FieldType& field()
const;
154 FieldType& fieldRef();
157 void storeOldTimesInner()
const;
160 void nullOldestTimeInner();
164 void setBase(
const nil&)
const;
168 template<
class OldTimeBaseField>
169 void setBase(
const OldTimeBaseField& otbf)
const;
172 void setBase()
const;
183 template<
template<
class>
class OtherPrimitiveField>
191 template<
template<
class>
class OtherPrimitiveField>
202 template<
class OtherFieldType>
206 template<
class OtherFieldType,
typename>
255 const Field0Type&
oldTime()
const;
278 template<
class FieldType,
typename =
void>
287 template<
class FieldType>
290 typedef typename FieldType::Base::OldTime
type;
294 return static_cast<const type&
>(otf.field());
303 template<
class FieldType>
321 #define USING_OLD_TIME_FIELD(FieldType) \
322 using OldTimeField<FieldType>::readOldTimeIfPresent; \
323 using OldTimeField<FieldType>::copyOldTimes; \
324 using OldTimeField<FieldType>::timeIndex; \
325 using OldTimeField<FieldType>::isOldTime; \
326 using OldTimeField<FieldType>::hasStoredOldTimes; \
327 using OldTimeField<FieldType>::storeOldTimes; \
328 using OldTimeField<FieldType>::clearOldTimes; \
329 using OldTimeField<FieldType>::nullOldestTime; \
330 using OldTimeField<FieldType>::nOldTimes; \
331 using OldTimeField<FieldType>::oldTime; \
332 using OldTimeField<FieldType>::oldTimeRef;
Pre-declare SubField and related Field type.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Class to add into field types to provide old-time storage and retrieval.
label timeIndex() const
Return the time index of the field.
bool readOldTimeIfPresent()
Read old-time field from file if it is present.
friend class OldTimeField
Declare friendship with other old-time fields.
void copyOldTimes(const IOobject &io, const OtherOldTime< OtherPrimitiveField > &)
Copy the old-times from the given field.
label nOldTimes(const bool includeNull=true) const
Return the number of old-time fields stored.
const Field0Type & oldTime() const
Return the old-time field.
Field0Type & oldTimeRef()
Return a non-const reference to the old-time field.
bool hasStoredOldTimes() const
Return whether old-time fields have been stored yet.
bool isOldTime() const
Return whether or not this is an old-time field.
void storeOldTimes() const
Store the old-time fields.
~OldTimeField()
Destructor.
void nullOldestTime()
Set the oldest field pointer to nullObjectPtr. This removes the.
void operator=(const OldTimeField< FieldType > &)=delete
Disallow default bitwise assignment.
void clearOldTimes()
Clear old-time fields.
Pre-declare related SubField type.
A zero-sized class without any storage. Used, for example, in HashSet.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
FieldType::Base::OldTime type
nil operator()(const OldTimeField< FieldType > &otf) const
tmp< Field0Type > operator()(const IOobject &io, const FieldType &field)
OldTimeField0Type< FieldType >::type Field0Type
GeoField< Type, GeoMesh, OtherPrimitiveField > type