![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Phantom dump table header for a specific type. More...
#include <shammodels/sph/include/shammodels/sph/io/PhantomDump.hpp>
Collaboration diagram for shammodels::sph::PhantomDumpTableHeader< T >:Public Member Functions | |
| void | add (std::string s, T val) |
| Adds an entry to the header. | |
| void | write (shambase::FortranIOFile &phfile) |
| Writes the header to a Phantom dump file. | |
| std::optional< T > | fetch (std::string s) const |
| Fetches the value of a given entry from the header. | |
| template<class Tb > | |
| void | fetch_multiple (std::vector< Tb > &vec, std::string s) |
| Fetches the values of all entries with a given name from the header into the supplied vector. | |
| void | print_state () |
| Prints the state of the header. | |
| template<class Tconv > | |
| void | add_to_map (std::unordered_map< std::string, Tconv > &map) |
Static Public Member Functions | |
| static PhantomDumpTableHeader< T > | from_file (shambase::FortranIOFile &phfile) |
| Reads the header from a Phantom dump file. | |
Public Attributes | |
| std::vector< std::pair< std::string, T > > | entries |
| A vector of pairs containing the name and the value of each entry in the table. | |
Phantom dump table header for a specific type.
This class is used to store the header of a Phantom dump file for one type.
| T | type of the data |
Definition at line 41 of file PhantomDump.hpp.
|
inline |
Adds an entry to the header.
| s | the name of the entry |
| val | the value of the entry |
Definition at line 62 of file PhantomDump.hpp.
|
inline |
Definition at line 114 of file PhantomDump.hpp.
|
inline |
Fetches the value of a given entry from the header.
| s | the name of the entry |
Definition at line 80 of file PhantomDump.hpp.
|
inline |
Fetches the values of all entries with a given name from the header into the supplied vector.
| vec | the vector to store the values in |
| s | the name of the entries |
Definition at line 100 of file PhantomDump.hpp.
|
static |
Reads the header from a Phantom dump file.
| phfile | the file to read from |
Definition at line 59 of file PhantomDump.cpp.
Here is the call graph for this function:| void shammodels::sph::PhantomDumpTableHeader< T >::print_state | ( | ) |
Prints the state of the header.
Definition at line 110 of file PhantomDump.cpp.
| void shammodels::sph::PhantomDumpTableHeader< T >::write | ( | shambase::FortranIOFile & | phfile | ) |
Writes the header to a Phantom dump file.
| phfile | the file to write to |
Definition at line 87 of file PhantomDump.cpp.
Here is the call graph for this function:| std::vector<std::pair<std::string, T> > shammodels::sph::PhantomDumpTableHeader< T >::entries |
A vector of pairs containing the name and the value of each entry in the table.
Definition at line 46 of file PhantomDump.hpp.