Database Class Reference
The class used to store and retrieve data of chemical species. More...
#include <Database.hpp>
Public Member Functions | |
Database () | |
Construct a default Database object. | |
Database (Database const &other) | |
Construct a copy of a Database object. | |
Database (Vec< Element > const &elements, Vec< Species > const &species) | |
Construct a Database object with given elements and species. | |
Database (Vec< Species > const &species) | |
Construct a Database object with given species (elements extracted from them). | |
~Database () | |
Destroy this Database object. | |
auto | operator= (Database other) -> Database & |
Assign another Database object to this. | |
auto | clear () -> void |
Remove all species and elements from the database. | |
auto | addElement (Element const &element) -> void |
Add an element in the database. More... | |
auto | addSpecies (Species const &species) -> void |
Add a species in the database. More... | |
auto | addSpecies (Vec< Species > const &species) -> void |
Add a list of species in the database. | |
auto | attachData (Any const &data) -> void |
Attach data to this database whose type is known at runtime only. | |
auto | extend (Database const &other) -> void |
Extend this database with elements, species and other contents from another database. | |
auto | elements () const -> ElementList const & |
Return all elements in the database. | |
auto | species () const -> SpeciesList const & |
Return all species in the database. | |
auto | speciesWithAggregateState (AggregateState option) const -> SpeciesList |
Return all species in the database with given aggregate state. | |
auto | element (String const &symbol) const -> Element const & |
Return an element with given symbol in the database. More... | |
auto | species (String const &name) const -> Species const & |
Return a species with given name in the database. More... | |
auto | reaction (String const &equation) const -> Reaction |
Construct a reaction with given equation. More... | |
auto | attachedData () const -> Any const & |
Return the attached data to this database whose type is known at runtime only. | |
Static Public Member Functions | |
static auto | fromFile (String const &path) -> Database |
Return a Database object constructed with a given local file. More... | |
static auto | fromEmbeddedFile (String const &path) -> Database |
Return a Database object constructed with a given embedded file. More... | |
static auto | fromContents (String const &contents) -> Database |
Return a Database object constructed with given database text contents. More... | |
static auto | fromStream (std::istream &stream) -> Database |
Return a Database object constructed with given input stream containing the database text contents. More... | |
static auto | local (String const &path) -> Database |
Return a Database object constructed with a given local file. More... | |
static auto | embedded (String const &path) -> Database |
Return a Database object constructed with a given embedded file. More... | |
Detailed Description
Member Function Documentation
◆ fromFile()
Return a Database object constructed with a given local file.
- Warning
- An exception is thrown if
path
does not point to a valid local database file.
- Parameters
-
path The path, including file name, to the local database file.
◆ fromEmbeddedFile()
Return a Database object constructed with a given embedded file.
- Warning
- An exception is thrown if
path
does not point to a valid embedded database file.
- Parameters
-
path The path, including file name, to the embedded database file.
◆ fromContents()
Return a Database object constructed with given database text contents.
- Parameters
-
contents The contents of the database as a string.
◆ fromStream()
|
static |
Return a Database object constructed with given input stream containing the database text contents.
- Parameters
-
stream The input stream containing the database file contents.
◆ local()
Return a Database object constructed with a given local file.
- Warning
- An exception is thrown if
path
does not point to a valid local database file.
- Parameters
-
path The path, including file name, to the local database file.
◆ embedded()
Return a Database object constructed with a given embedded file.
- Warning
- An exception is thrown if
path
does not point to a valid embedded database file.
- Parameters
-
path The path, including file name, to the embedded database file.
◆ addElement()
auto addElement | ( | Element const & | element | ) | -> void |
◆ addSpecies()
auto addSpecies | ( | Species const & | species | ) | -> void |
◆ element()
Return an element with given symbol in the database.
- Warning
- An exception is thrown if no element with given symbol exists.
◆ species()
Return a species with given name in the database.
- Warning
- An exception is thrown if no species with given name exists.
◆ reaction()
Construct a reaction with given equation.
- Warning
- An exception is thrown if the reaction has an inexistent species in the database.
The documentation for this class was generated from the following file:
- Reaktoro/Core/Database.hpp