NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
NeoFOAM::finiteVolume::cellCentred::OldTimeCollection Class Reference

#include <oldTimeCollection.hpp>

Inheritance diagram for NeoFOAM::finiteVolume::cellCentred::OldTimeCollection:
NeoFOAM::CollectionMixin< OldTimeDocument >

Public Member Functions

 OldTimeCollection (Database &db, std::string name, std::string fieldCollectionName)
 
bool contains (const std::string &id) const
 
bool insert (const OldTimeDocument &cc)
 
std::string findNextTime (std::string id) const
 
std::string findPreviousTime (std::string id) const
 
OldTimeDocumentoldTimeDoc (const std::string &id)
 
const OldTimeDocumentoldTimeDoc (const std::string &id) const
 
template<typename FieldType >
FieldType & getOrInsert (std::string idOfNextField)
 
template<typename FieldType >
const FieldType & get (std::string idOfNextField) const
 
- Public Member Functions inherited from NeoFOAM::CollectionMixin< OldTimeDocument >
 CollectionMixin (NeoFOAM::Database &db, std::string name)
 Constructs a CollectionMixin with the given database and collection name.
 
 CollectionMixin (const CollectionMixin &)=delete
 
 CollectionMixin (CollectionMixin &&)=default
 
CollectionMixinoperator= (const CollectionMixin &)=delete
 
CollectionMixinoperator= (CollectionMixin &&)=delete
 
Documentdoc (const std::string &id)
 Retrieves a document by its ID.
 
const Documentdoc (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::Databasedb () const
 Gets a const reference to the database.
 
NeoFOAM::Databasedb ()
 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 OldTimeCollectioninstance (Database &db, std::string name, std::string fieldCollectionName)
 
static const OldTimeCollectioninstance (const Database &db, std::string name)
 
static OldTimeCollectioninstance (FieldCollection &fieldCollection)
 
static const OldTimeCollectioninstance (const FieldCollection &fieldCollection)
 

Additional Inherited Members

- Protected Attributes inherited from NeoFOAM::CollectionMixin< OldTimeDocument >
std::unordered_map< std::string, OldTimeDocument > docs_
 The map of document IDs to documents.
 
NeoFOAM::Databasedb_
 The reference to the database.
 
std::string name_
 The name of the collection.
 

Detailed Description

Definition at line 56 of file oldTimeCollection.hpp.

Constructor & Destructor Documentation

◆ OldTimeCollection()

NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::OldTimeCollection ( Database db,
std::string  name,
std::string  fieldCollectionName 
)

Member Function Documentation

◆ contains()

bool NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::contains ( const std::string &  id) const

◆ findNextTime()

std::string NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::findNextTime ( std::string  id) const

◆ findPreviousTime()

std::string NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::findPreviousTime ( std::string  id) const

◆ get()

template<typename FieldType >
const FieldType & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::get ( std::string  idOfNextField) const
inline

Definition at line 103 of file oldTimeCollection.hpp.

◆ getOrInsert()

template<typename FieldType >
FieldType & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::getOrInsert ( std::string  idOfNextField)
inline

Definition at line 75 of file oldTimeCollection.hpp.

◆ insert()

bool NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::insert ( const OldTimeDocument cc)

◆ instance() [1/4]

static const OldTimeCollection & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::instance ( const Database db,
std::string  name 
)
static

◆ instance() [2/4]

static const OldTimeCollection & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::instance ( const FieldCollection fieldCollection)
static

◆ instance() [3/4]

static OldTimeCollection & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::instance ( Database db,
std::string  name,
std::string  fieldCollectionName 
)
static

◆ instance() [4/4]

static OldTimeCollection & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::instance ( FieldCollection fieldCollection)
static

◆ oldTimeDoc() [1/2]

OldTimeDocument & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::oldTimeDoc ( const std::string &  id)

◆ oldTimeDoc() [2/2]

const OldTimeDocument & NeoFOAM::finiteVolume::cellCentred::OldTimeCollection::oldTimeDoc ( const std::string &  id) const

The documentation for this class was generated from the following file: