SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
serif::eos::EOSio Class Reference

Handles the input/output operations for EOS tables. More...

#include <EOSio.h>

Public Member Functions

 EOSio (const std::string &filename, EOSFormat format=EOSFormat::HELM)
 Constructs an EosIO object with the given filename.
 
 EOSio (const EOSio &other)
 Explicit copy constructor.
 
 ~EOSio ()=default
 Default destructor.
 
std::string getFormatName () const
 Gets the format name (as a string) of the EOS table.
 
EOSFormat getFormat () const
 
EOSTablegetTable ()
 Gets the EOS table.
 
std::string getFilename () const
 
bool isLoaded () const
 

Private Member Functions

void load ()
 Loads the EOS table from the file.
 
void loadHelm ()
 Loads the HELM format EOS table.
 

Private Attributes

std::string m_filename
 The filename of the EOS table.
 
bool m_loaded = false
 Flag indicating if the table is loaded.
 
EOSFormat m_format
 
EOSTable m_table
 The EOS table data.
 

Detailed Description

Handles the input/output operations for EOS tables.

The EosIO class is responsible for loading and managing EOS tables from files. It supports different formats, currently only HELM format.

Example usage:

EOSio eosReader("path/to/file");
std::string format = eosReader.getFormatName();
EOSTable& table = eosReader.getTable();
EOSio(const std::string &filename, EOSFormat format=EOSFormat::HELM)
Constructs an EosIO object with the given filename.
Definition EOSio.cpp:31
std::variant< std::unique_ptr< serif::eos::helmholtz::HELMTable > > EOSTable
Definition EOSio.h:38
Note
The default format used for reading tables is HELM
Currently only the HELM format is implemented

Definition at line 57 of file EOSio.h.

Constructor & Destructor Documentation

◆ EOSio() [1/2]

serif::eos::EOSio::EOSio ( const std::string & filename,
EOSFormat format = EOSFormat::HELM )
explicit

Constructs an EosIO object with the given filename.

Parameters
filenameThe filename of the EOS table.
formatThe EOS file format (currently only HELM)

Definition at line 31 of file EOSio.cpp.

◆ EOSio() [2/2]

serif::eos::EOSio::EOSio ( const EOSio & other)

Explicit copy constructor.

Parameters
otherThe EOSio to be copied

Definition at line 35 of file EOSio.cpp.

◆ ~EOSio()

serif::eos::EOSio::~EOSio ( )
default

Default destructor.

Member Function Documentation

◆ getFilename()

std::string serif::eos::EOSio::getFilename ( ) const
inlinenodiscard

Definition at line 106 of file EOSio.h.

◆ getFormat()

EOSFormat serif::eos::EOSio::getFormat ( ) const
nodiscard

Definition at line 41 of file EOSio.cpp.

◆ getFormatName()

std::string serif::eos::EOSio::getFormatName ( ) const
nodiscard

Gets the format name (as a string) of the EOS table.

Returns
The format of the EOS table as a string.

Definition at line 46 of file EOSio.cpp.

◆ getTable()

EOSTable & serif::eos::EOSio::getTable ( )
nodiscard

Gets the EOS table.

Returns
A reference to the EOS table.

Definition at line 51 of file EOSio.cpp.

◆ isLoaded()

bool serif::eos::EOSio::isLoaded ( ) const
inline

Definition at line 108 of file EOSio.h.

◆ load()

void serif::eos::EOSio::load ( )
private

Loads the EOS table from the file.

Definition at line 55 of file EOSio.cpp.

◆ loadHelm()

void serif::eos::EOSio::loadHelm ( )
private

Loads the HELM format EOS table.

Definition at line 61 of file EOSio.cpp.

Member Data Documentation

◆ m_filename

std::string serif::eos::EOSio::m_filename
private

The filename of the EOS table.

Definition at line 59 of file EOSio.h.

◆ m_format

EOSFormat serif::eos::EOSio::m_format
private

Definition at line 61 of file EOSio.h.

◆ m_loaded

bool serif::eos::EOSio::m_loaded = false
private

Flag indicating if the table is loaded.

Definition at line 60 of file EOSio.h.

◆ m_table

EOSTable serif::eos::EOSio::m_table
private

The EOS table data.

Definition at line 62 of file EOSio.h.


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