bpp-phyl3 3.0.0
IoFrequencySetFactory.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
6
7using namespace bpp;
8
9const std::string IOFrequencySetFactory::BPPO_FORMAT = "Bpp0";
10
11std::unique_ptr<IFrequencySet> IOFrequencySetFactory::createReader(const std::string& format)
12{
13 if (format == BPPO_FORMAT)
14 return std::make_unique<BppOFrequencySetFormat>(BppOFrequencySetFormat::ALL, true, 1);
15 else
16 throw Exception("Format " + format + " is not supported for input.");
17}
18
19std::unique_ptr<OFrequencySet> IOFrequencySetFactory::createWriter(const std::string& format)
20{
21 if (format == BPPO_FORMAT)
22 return std::make_unique<BppOFrequencySetFormat>(BppOFrequencySetFormat::ALL, true, 1);
23 else
24 throw Exception("Format " + format + " is not supported for output.");
25}
virtual std::unique_ptr< OFrequencySet > createWriter(const std::string &format)
Get a new dynamically created OFrequencySet object.
static const std::string BPPO_FORMAT
Defines the basic types of data flow nodes.