GridFire 0.0.1a General Purpose Nuclear Network

Loading...
Searching...
No Matches
network_file.h
Go to the documentation of this file.
1#pragma once
2
3#include "fourdst/config/config.h"
4#include "fourdst/logging/logging.h"
5
6#include "quill/Logger.h"
7
8#include <string>
9#include <vector>
10
11 namespace gridfire::io {
12 typedef std::vector<std::string> ParsedNetworkData;
13
22 class NetworkFileParser {
23 public:
27 virtual ~NetworkFileParser() = default;
28
55 [[nodiscard]] virtual ParsedNetworkData parse(const std::string& filename) const = 0;
56
57 };
58
68 class SimpleReactionListFileParser final : public NetworkFileParser {
69 public:
75 explicit SimpleReactionListFileParser();
102 ParsedNetworkData parse(const std::string& filename) const override;
103 private:
104 using Config = fourdst::config::Config;
105 using LogManager = fourdst::logging::LogManager;
106 Config& m_config = Config::getInstance();
107 quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
108 };
109
119 class MESANetworkFileParser final : public NetworkFileParser {
120 public:
129 explicit MESANetworkFileParser(const std::string& filename);
142 ParsedNetworkData parse(const std::string& filename) const override;
143 private:
144 using Config = fourdst::config::Config;
145 using LogManager = fourdst::logging::LogManager;
146 Config& m_config = Config::getInstance();
147 quill::Logger* m_logger = LogManager::getInstance().getLogger("log");
148
149 std::string m_filename;
150 };
151}
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