Loading...
Searching...
No Matches
network_file.h
Go to the documentation of this file.
#pragma once
#include "fourdst/config/config.h"
#include "fourdst/logging/logging.h"
#include "quill/Logger.h"
#include <string>
#include <vector>
namespace gridfire::io {
typedef std::vector<std::string> ParsedNetworkData;
class NetworkFileParser {
public:
virtual ~NetworkFileParser() = default;
[[nodiscard]] virtual ParsedNetworkData parse(const std::string& filename) const = 0;
};
class SimpleReactionListFileParser final : public NetworkFileParser {
public:
explicit SimpleReactionListFileParser();
ParsedNetworkData parse(const std::string& filename) const override;
private:
using Config = fourdst::config::Config;
using LogManager = fourdst::logging::LogManager;
Config& m_config = Config::getInstance();
quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
};
class MESANetworkFileParser final : public NetworkFileParser {
public:
explicit MESANetworkFileParser(const std::string& filename);
ParsedNetworkData parse(const std::string& filename) const override;
private:
using Config = fourdst::config::Config;
using LogManager = fourdst::logging::LogManager;
Config& m_config = Config::getInstance();
quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
std::string m_filename;
};
}
gridfire::io::MESANetworkFileParser::parse
ParsedNetworkData parse(const std::string &filename) const override
Parses a MESA-format network file.
gridfire::io::MESANetworkFileParser::LogManager
fourdst::logging::LogManager LogManager
Definition network_file.h:145
gridfire::io::MESANetworkFileParser::m_filename
std::string m_filename
Definition network_file.h:149
gridfire::io::MESANetworkFileParser::m_logger
quill::Logger * m_logger
Definition network_file.h:147
gridfire::io::MESANetworkFileParser::MESANetworkFileParser
MESANetworkFileParser(const std::string &filename)
Constructs a MESANetworkFileParser.
gridfire::io::MESANetworkFileParser::m_config
Config & m_config
Definition network_file.h:146
gridfire::io::MESANetworkFileParser::Config
fourdst::config::Config Config
Definition network_file.h:144
gridfire::io::NetworkFileParser
An abstract base class for network file parsers.
Definition network_file.h:22
gridfire::io::NetworkFileParser::parse
virtual ParsedNetworkData parse(const std::string &filename) const =0
Parses a network file and returns the parsed data.
gridfire::io::NetworkFileParser::~NetworkFileParser
virtual ~NetworkFileParser()=default
Virtual destructor for the base class.
gridfire::io::SimpleReactionListFileParser::m_config
Config & m_config
Definition network_file.h:106
gridfire::io::SimpleReactionListFileParser::parse
ParsedNetworkData parse(const std::string &filename) const override
Parses a simple reaction list file.
Definition network_file.cpp:44
gridfire::io::SimpleReactionListFileParser::LogManager
fourdst::logging::LogManager LogManager
Definition network_file.h:105
gridfire::io::SimpleReactionListFileParser::m_logger
quill::Logger * m_logger
Definition network_file.h:107
gridfire::io::SimpleReactionListFileParser::Config
fourdst::config::Config Config
Definition network_file.h:104
gridfire::io::SimpleReactionListFileParser::SimpleReactionListFileParser
SimpleReactionListFileParser()
Constructs a SimpleReactionListFileParser.
Definition network_file.cpp:42
gridfire::io
Definition network_file.h:11
gridfire::io::ParsedNetworkData
std::vector< std::string > ParsedNetworkData
Definition network_file.h:12