A class representing a collection of field documents in a database.
More...
#include <fieldCollection.hpp>
|
| FieldCollection (NeoFOAM::Database &db, std::string name) |
| Constructs a FieldCollection with the given database and name.
|
|
bool | contains (const std::string &id) const |
| Checks if the collection contains a field with the given ID.
|
|
std::string | insert (const FieldDocument &fd) |
| Inserts a field document into the collection.
|
|
FieldDocument & | fieldDoc (const std::string &id) |
| Retrieves a field document by its ID.
|
|
const FieldDocument & | fieldDoc (const std::string &id) const |
| Retrieves a field document by its ID (const version).
|
|
template<class FieldType > |
FieldType & | registerField (CreateFunction createFunc) |
| Registers a field in the collection.
|
|
| CollectionMixin (NeoFOAM::Database &db, std::string name) |
| Constructs a CollectionMixin with the given database and collection name.
|
|
Document & | doc (const std::string &id) |
| Retrieves a document by its ID.
|
|
const Document & | doc (const std::string &id) const |
| Retrieves a document by its ID (const version).
|
|
std::vector< std::string > | find (const std::function< bool(const Document &)> &predicate) const |
| Finds documents that match a given predicate.
|
|
std::size_t | size () const |
| Gets the number of documents in the collection.
|
|
const NeoFOAM::Database & | db () const |
| Gets a const reference to the database.
|
|
NeoFOAM::Database & | db () |
| Gets a reference to the database.
|
|
const std::string & | name () const |
| Gets the name of the collection.
|
|
std::string | type () const |
| Gets the type name of the documents in the collection.
|
|
std::vector< std::string > | sortedKeys () const |
| Gets the sorted keys of the documents in the collection.
|
|
|
std::unordered_map< std::string, FieldDocument > | docs_ |
| The map of document IDs to documents.
|
|
NeoFOAM::Database & | db_ |
| The reference to the database.
|
|
std::string | name_ |
| The name of the collection.
|
|
A class representing a collection of field documents in a database.
The FieldCollection class represents a collection of field documents in a database and provides additional functionality for accessing field-specific data.
Definition at line 205 of file fieldCollection.hpp.
◆ FieldCollection()
NeoFOAM::finiteVolume::cellCentred::FieldCollection::FieldCollection |
( |
NeoFOAM::Database & |
db, |
|
|
std::string |
name |
|
) |
| |
Constructs a FieldCollection with the given database and name.
- Parameters
-
db | The database to create the collection in. |
name | The name of the collection. |
◆ contains()
bool NeoFOAM::finiteVolume::cellCentred::FieldCollection::contains |
( |
const std::string & |
id | ) |
const |
Checks if the collection contains a field with the given ID.
- Parameters
-
id | The ID of the field to check for. |
- Returns
- true if the collection contains the field, false otherwise.
◆ fieldDoc() [1/2]
FieldDocument & NeoFOAM::finiteVolume::cellCentred::FieldCollection::fieldDoc |
( |
const std::string & |
id | ) |
|
Retrieves a field document by its ID.
- Parameters
-
id | The ID of the field document to retrieve. |
- Returns
- FieldDocument& A reference to the field document.
◆ fieldDoc() [2/2]
const FieldDocument & NeoFOAM::finiteVolume::cellCentred::FieldCollection::fieldDoc |
( |
const std::string & |
id | ) |
const |
Retrieves a field document by its ID (const version).
- Parameters
-
id | The ID of the field document to retrieve. |
- Returns
- const FieldDocument& A const reference to the field document.
◆ insert()
std::string NeoFOAM::finiteVolume::cellCentred::FieldCollection::insert |
( |
const FieldDocument & |
fd | ) |
|
Inserts a field document into the collection.
- Parameters
-
fd | The field document to insert. |
- Returns
- A string representing the unique identifier of the inserted field.
◆ instance() [1/4]
template<class FieldType >
static const FieldCollection & NeoFOAM::finiteVolume::cellCentred::FieldCollection::instance |
( |
const FieldType & |
field | ) |
|
|
inlinestatic |
◆ instance() [2/4]
◆ instance() [3/4]
template<class FieldType >
static FieldCollection & NeoFOAM::finiteVolume::cellCentred::FieldCollection::instance |
( |
FieldType & |
field | ) |
|
|
inlinestatic |
◆ instance() [4/4]
◆ registerField()
template<class FieldType >
FieldType & NeoFOAM::finiteVolume::cellCentred::FieldCollection::registerField |
( |
CreateFunction |
createFunc | ) |
|
|
inline |
Registers a field in the collection.
- Template Parameters
-
FieldType | The type of the field to register. |
- Parameters
-
createFunc | The function to create the field document. |
- Returns
- A reference to the registered field.
Definition at line 313 of file fieldCollection.hpp.
The documentation for this class was generated from the following file: