NeoN
WIP Prototype of a modern OpenFOAM core
|
A class representing a collection of field documents in a database. More...
#include <fieldCollection.hpp>
Public Member Functions | |
VectorCollection (NeoN::Database &db, std::string name) | |
Constructs a VectorCollection with the given database and name. | |
VectorCollection (const VectorCollection &)=delete | |
A VectorCollection is not copyable, but moveable. | |
VectorCollection & | operator= (const VectorCollection &)=delete |
A VectorCollection is not copyable, but moveable. | |
VectorCollection (VectorCollection &&)=default | |
A VectorCollection is move constructable, but not copyable. | |
VectorCollection & | operator= (VectorCollection &&)=delete |
A VectorCollection is not move-assign-able, but move-construct-able. | |
bool | contains (const std::string &id) const |
Checks if the collection contains a field with the given ID. | |
std::string | insert (const VectorDocument &fd) |
Inserts a field document into the collection. | |
VectorDocument & | fieldDoc (const std::string &id) |
Retrieves a field document by its ID. | |
const VectorDocument & | fieldDoc (const std::string &id) const |
Retrieves a field document by its ID (const version). | |
template<class VectorType > | |
VectorType & | registerVector (CreateFunction createFunc) |
Registers a field in the collection. | |
![]() | |
CollectionMixin (NeoN::Database &db, std::string name) | |
Constructs a CollectionMixin with the given database and collection name. | |
CollectionMixin (const CollectionMixin &)=delete | |
CollectionMixin (CollectionMixin &&)=default | |
CollectionMixin & | operator= (const CollectionMixin &)=delete |
CollectionMixin & | operator= (CollectionMixin &&)=delete |
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 NeoN::Database & | db () const |
Gets a const reference to the database. | |
NeoN::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. | |
Static Public Member Functions | |
static VectorCollection & | instance (NeoN::Database &db, std::string name) |
Retrieves the instance of the VectorCollection with the given name. | |
static const VectorCollection & | instance (const NeoN::Database &db, std::string name) |
Retrieves the instance of the VectorCollection with the given name (const version). | |
template<class VectorType > | |
static VectorCollection & | instance (VectorType &field) |
Retrieves the instance of the VectorCollection from a const registered VectorType. | |
template<class VectorType > | |
static const VectorCollection & | instance (const VectorType &field) |
Retrieves the instance of the VectorCollection from a const registered VectorType. | |
Additional Inherited Members | |
![]() | |
std::unordered_map< std::string, VectorDocument > | docs_ |
The map of document IDs to documents. | |
NeoN::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 VectorCollection class represents a collection of field documents in a database and provides additional functionality for accessing field-specific data.
Definition at line 207 of file fieldCollection.hpp.
NeoN::finiteVolume::cellCentred::VectorCollection::VectorCollection | ( | NeoN::Database & | db, |
std::string | name | ||
) |
Constructs a VectorCollection with the given database and name.
db | The database to create the collection in. |
name | The name of the collection. |
|
delete |
A VectorCollection is not copyable, but moveable.
|
default |
A VectorCollection is move constructable, but not copyable.
bool NeoN::finiteVolume::cellCentred::VectorCollection::contains | ( | const std::string & | id | ) | const |
Checks if the collection contains a field with the given ID.
id | The ID of the field to check for. |
VectorDocument & NeoN::finiteVolume::cellCentred::VectorCollection::fieldDoc | ( | const std::string & | id | ) |
Retrieves a field document by its ID.
id | The ID of the field document to retrieve. |
const VectorDocument & NeoN::finiteVolume::cellCentred::VectorCollection::fieldDoc | ( | const std::string & | id | ) | const |
Retrieves a field document by its ID (const version).
id | The ID of the field document to retrieve. |
std::string NeoN::finiteVolume::cellCentred::VectorCollection::insert | ( | const VectorDocument & | fd | ) |
Inserts a field document into the collection.
fd | The field document to insert. |
|
static |
Retrieves the instance of the VectorCollection with the given name (const version).
creates the VectorCollection if it does not exist.
db | The database to retrieve the VectorCollection from. |
name | The name of the VectorCollection. |
|
inlinestatic |
Retrieves the instance of the VectorCollection from a const registered VectorType.
field | A registered VectorType |
Definition at line 316 of file fieldCollection.hpp.
|
static |
Retrieves the instance of the VectorCollection with the given name.
creates the VectorCollection if it does not exist.
db | The database to retrieve the VectorCollection from. |
name | The name of the VectorCollection. |
|
inlinestatic |
Retrieves the instance of the VectorCollection from a const registered VectorType.
field | A registered VectorType |
Definition at line 301 of file fieldCollection.hpp.
|
delete |
A VectorCollection is not copyable, but moveable.
|
delete |
A VectorCollection is not move-assign-able, but move-construct-able.
|
inline |
Registers a field in the collection.
VectorType | The type of the field to register. |
createFunc | The function to create the field document. |
Definition at line 335 of file fieldCollection.hpp.