deltaFlow
ReaderFactory.C
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Saud Zahir
3 *
4 * This file is part of deltaFlow.
5 *
6 * deltaFlow is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * deltaFlow is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with deltaFlow. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
21#include "ReaderFactory.H"
22
23#include "Argparse.H"
24#include "IEEE.H"
25#include "PSSE.H"
26
27std::unique_ptr<Reader> ReaderFactory::create(InputFormat format) {
28 switch (format) {
30 return std::make_unique<IEEECommonDataFormat>();
32 return std::make_unique<PSSERawFormat>();
33 default:
34 return nullptr;
35 }
36}
Command-line argument parsing utilities for deltaFlow.
InputFormat
Supported input file formats.
Definition Argparse.H:52
@ IEEE
IEEE Common Data Format (.cdf, .txt)
@ PSSE
PSS/E Raw Data Format (.raw)
IEEE Common Data Format reader for deltaFlow.
PSS/E Raw Data Format reader for deltaFlow.
Factory for constructing Reader instances from InputFormat, so callers (e.g.
static std::unique_ptr< Reader > create(InputFormat format)
Construct a concrete reader for the given input format.