46 std::string
id()
const;
74 template<
typename FieldType>
87 std::string oldTimeName = fieldDoc.
field<FieldType>().
name +
"_0";
91 .field = fieldDoc.
field<FieldType>(),
97 setCurrentFieldAndLevel(oldTimeDocument);
102 template<
typename FieldType>
103 const FieldType&
get(std::string idOfNextField)
const
135 std::string fieldCollectionName_;
146template<
typename FieldType>
151 return oldTimeCollection.
getOrInsert<FieldType>(field.key);
162template<
typename FieldType>
163const FieldType&
oldTime(
const FieldType& field)
167 return oldTimeCollection.
get<FieldType>(field.key);
A mixin class for collection of documents in a database to simplify the implementation of common oper...
const std::string & name() const
Gets the name of the collection.
const NeoFOAM::Database & db() const
Gets a const reference to the database.
A class representing a document in a database.
Creates a FieldDocument from an existing field.
A class representing a collection of field documents in a database.
FieldType & registerField(CreateFunction createFunc)
Registers a field in the collection.
static FieldCollection & instance(NeoFOAM::Database &db, std::string name)
Retrieves the instance of the FieldCollection with the given name.
FieldDocument & fieldDoc(const std::string &id)
Retrieves a field document by its ID.
A class representing a field document in a database.
FieldType & field()
Retrieves the field from the document.
std::int64_t timeIndex() const
Retrieves the time index of the field.
std::int64_t subCycleIndex() const
Retrieves the sub-cycle index of the field.
std::int64_t iterationIndex() const
Retrieves the iteration index of the field.
const FieldType & get(std::string idOfNextField) const
OldTimeDocument & oldTimeDoc(const std::string &id)
const OldTimeDocument & oldTimeDoc(const std::string &id) const
std::string findNextTime(std::string id) const
FieldType & getOrInsert(std::string idOfNextField)
static OldTimeCollection & instance(Database &db, std::string name, std::string fieldCollectionName)
static const OldTimeCollection & instance(const FieldCollection &fieldCollection)
bool insert(const OldTimeDocument &cc)
std::string findPreviousTime(std::string id) const
bool contains(const std::string &id) const
static const OldTimeCollection & instance(const Database &db, std::string name)
static OldTimeCollection & instance(FieldCollection &fieldCollection)
OldTimeCollection(Database &db, std::string name, std::string fieldCollectionName)
std::string & previousTime()
const int32_t & level() const
const Document & doc() const
const std::string & currentTime() const
OldTimeDocument(std::string nextTime, std::string previousTime, std::string currentTime, int32_t level)
const std::string & nextTime() const
std::string & currentTime()
const std::string & previousTime() const
static std::string typeName()
OldTimeDocument(const Document &doc)
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
FieldType & oldTime(FieldType &field)
Retrieves the old time field of a given field.