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

A class that represents a stencil database. More...

#include <stencilDataBase.hpp>

Public Member Functions

 StencilDataBase ()=default
 Default constructor for StencilDataBase.
 
template<typename T >
void insert (const std::string &key, T value)
 Inserts a value into the stencil database.
 
std::any & operator[] (const std::string &key)
 Retrieves a reference to the value associated with the given key.
 
const std::any & operator[] (const std::string &key) const
 Retrieves a const reference to the value associated with the given key.
 
template<typename T >
T & get (const std::string &key)
 Retrieves a reference to the value associated with the given key.
 
template<typename T >
const T & get (const std::string &key) const
 Retrieves a const reference to the value associated with the given key.
 
bool contains (const std::string &key) const
 Checks if the stencil database contains a value associated with the given key.
 

Detailed Description

A class that represents a stencil database.

The StencilDataBase class provides a container for storing stencil data. It allows insertion, retrieval, and checking of stencil data using string keys.

Definition at line 19 of file stencilDataBase.hpp.

Constructor & Destructor Documentation

◆ StencilDataBase()

NeoFOAM::StencilDataBase::StencilDataBase ( )
default

Default constructor for StencilDataBase.

Member Function Documentation

◆ contains()

bool NeoFOAM::StencilDataBase::contains ( const std::string &  key) const

Checks if the stencil database contains a value associated with the given key.

Parameters
keyThe key to check.
Returns
true if the database contains the key, false otherwise.

◆ get() [1/2]

template<typename T >
T & NeoFOAM::StencilDataBase::get ( const std::string &  key)
inline

Retrieves a reference to the value associated with the given key.

Template Parameters
TThe type of the value to be retrieved.
Parameters
keyThe key associated with the value.
Returns
A reference to the value associated with the key.
Exceptions
std::bad_any_castif the value cannot be cast to type T.

Definition at line 67 of file stencilDataBase.hpp.

◆ get() [2/2]

template<typename T >
const T & NeoFOAM::StencilDataBase::get ( const std::string &  key) const
inline

Retrieves a const reference to the value associated with the given key.

Template Parameters
TThe type of the value to be retrieved.
Parameters
keyThe key associated with the value.
Returns
A const reference to the value associated with the key.
Exceptions
std::bad_any_castif the value cannot be cast to type T.

Definition at line 82 of file stencilDataBase.hpp.

◆ insert()

template<typename T >
void NeoFOAM::StencilDataBase::insert ( const std::string &  key,
value 
)
inline

Inserts a value into the stencil database.

Template Parameters
TThe type of the value to be inserted.
Parameters
keyThe key associated with the value.
valueThe value to be inserted.

Definition at line 36 of file stencilDataBase.hpp.

◆ operator[]() [1/2]

std::any & NeoFOAM::StencilDataBase::operator[] ( const std::string &  key)

Retrieves a reference to the value associated with the given key.

Parameters
keyThe key associated with the value.
Returns
A reference to the value associated with the key.

◆ operator[]() [2/2]

const std::any & NeoFOAM::StencilDataBase::operator[] ( const std::string &  key) const

Retrieves a const reference to the value associated with the given key.

Parameters
keyThe key associated with the value.
Returns
A const reference to the value associated with the key.

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