36 #ifndef OldTimeField_H
37 #define OldTimeField_H
47 template<
class FieldType>
63 template<
class FieldType,
typename =
void>
72 template<
class FieldType>
79 typedef typename FieldType::Base::OldTime
type;
83 return static_cast<const type&
>(otf.field());
92 template<
class FieldType>
108 mutable label timeIndex_;
117 const FieldType& field()
const;
120 FieldType& fieldRef();
123 void storeOldTimesInner()
const;
126 void nullOldestTimeInner();
130 void setBase(
const nil&)
const;
134 template<
class OldTimeBaseField>
135 void setBase(
const OldTimeBaseField& otbf)
const;
138 void setBase()
const;
166 template<
class OtherFieldType>
170 template<
class OtherFieldType,
typename>
216 const FieldType&
oldTime()
const;
241 #define USING_OLD_TIME_FIELD(FieldType) \
242 using OldTimeField<FieldType>::readOldTimeIfPresent; \
243 using OldTimeField<FieldType>::copyOldTimes; \
244 using OldTimeField<FieldType>::timeIndex; \
245 using OldTimeField<FieldType>::isOldTime; \
246 using OldTimeField<FieldType>::storeOldTimes; \
247 using OldTimeField<FieldType>::clearOldTimes; \
248 using OldTimeField<FieldType>::nullOldestTime; \
249 using OldTimeField<FieldType>::nOldTimes; \
250 using OldTimeField<FieldType>::oldTime; \
251 using OldTimeField<FieldType>::oldTimeRef;
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.
const FieldType & oldTime() const
Return the old time field.
label nOldTimes(const bool includeNull=true) const
Return the number of old time fields stored.
void copyOldTimes(const IOobject &io, const OldTimeField< FieldType > &otf)
Copy the old times from the given field.
FieldType & oldTimeRef()
Return a non-const reference to the old time field.
bool isOldTime() const
Return whether or not this is an old-time field.
OldTimeField< FieldType > OldTime
The old-time field type.
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.
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