bpp-core3  3.0.0
IoDiscreteDistributionFactory.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 
7 using namespace bpp;
8 
9 const std::string IoDiscreteDistributionFactory::BPPO_FORMAT = "Bpp0";
10 
12 {
13  if (format == BPPO_FORMAT)
14  return new BppODiscreteDistributionFormat();
15  else
16  throw Exception("Format " + format + " is not supported for input.");
17 }
18 
20 {
21  if (format == BPPO_FORMAT)
22  return new BppODiscreteDistributionFormat();
23  else
24  throw Exception("Format " + format + " is not supported for output.");
25 }
General interface for distance matrix readers.
General interface writers.
virtual ODiscreteDistribution * createWriter(const std::string &format)
Get a new dynamically created ODiscreteDistribution object.
virtual IDiscreteDistribution * createReader(const std::string &format)
Get a new dynamically created IDiscreteDistribution object.
Exception base class. Overload exception constructor (to control the exceptions mechanism). Destructor is already virtual (from std::exception)
Definition: Exceptions.h:20
Discrete Distribution I/O in BppO format.