Loading...
Searching...
No Matches
PyNetworkFileParser Class Referencefinal

`#include <py_io.h>`

Inheritance diagram for PyNetworkFileParser:
[legend]
Collaboration diagram for PyNetworkFileParser:
[legend]

## Private Member Functions

gridfire::io::ParsedNetworkData | parse (const std::string &filename) const override
| Parses a network file and returns the parsed data.

## Additional Inherited Members

Public Member Functions inherited from gridfire::io::NetworkFileParser
virtual | ~NetworkFileParser ()=default
| Virtual destructor for the base class.

## Member Function Documentation

## parse()

gridfire::io::ParsedNetworkData PyNetworkFileParser::parse | ( | const std::string & | filename | ) | const

overrideprivatevirtual

Parses a network file and returns the parsed data.

This is a pure virtual function that must be implemented by derived classes. It takes a filename as input and returns a `ParsedNetworkData` struct containing the information extracted from the file.

Parameters

  filename | The path to the network file to parse.

Returns
  A `ParsedNetworkData` struct containing the parsed reaction data.

Exceptions

  std::runtime_error | If the file cannot be opened or a parsing error occurs.

Usage

std::unique_ptr<NetworkFileParser> parser = std::make_unique<SimpleReactionListFileParser>();
try {
ParsedNetworkData data = parser->parse("my_reactions.txt");
for (const auto& reaction_name : data.reactionPENames) {
// ... process reaction name
}
} catch (const std::runtime_error& e) {
// ... handle error
}

Implements gridfire::io::NetworkFileParser.

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

- src/python/io/trampoline/py_io.h
- src/python/io/trampoline/py_io.cpp