bpp-core3  3.0.0
bpp::IoDiscreteDistributionFactory Class Reference

Utilitary class for creating discrete distribution readers and writers. More...

#include <Bpp/Io/IoDiscreteDistributionFactory.h>

+ Collaboration diagram for bpp::IoDiscreteDistributionFactory:

Public Member Functions

 IoDiscreteDistributionFactory ()
 Creates a new factory object. More...
 
virtual ~IoDiscreteDistributionFactory ()
 
virtual IDiscreteDistributioncreateReader (const std::string &format)
 Get a new dynamically created IDiscreteDistribution object. More...
 
virtual ODiscreteDistributioncreateWriter (const std::string &format)
 Get a new dynamically created ODiscreteDistribution object. More...
 

Static Public Attributes

static const std::string BPPO_FORMAT = "Bpp0"
 

Detailed Description

Utilitary class for creating discrete distribution readers and writers.

Definition at line 22 of file IoDiscreteDistributionFactory.h.

Constructor & Destructor Documentation

◆ IoDiscreteDistributionFactory()

bpp::IoDiscreteDistributionFactory::IoDiscreteDistributionFactory ( )
inline

Creates a new factory object.

Example:

IDiscreteDistribution* distReader = IoDiscreteDistributionFactory().createReader(IoDiscreteDistributionFactory::BPP_FORMAT);
DiscreteDistribution* dist = distReader->read(...);
delete distReader;

Definition at line 38 of file IoDiscreteDistributionFactory.h.

◆ ~IoDiscreteDistributionFactory()

virtual bpp::IoDiscreteDistributionFactory::~IoDiscreteDistributionFactory ( )
inlinevirtual

Definition at line 39 of file IoDiscreteDistributionFactory.h.

References createReader(), and createWriter().

Member Function Documentation

◆ createReader()

IDiscreteDistribution * IoDiscreteDistributionFactory::createReader ( const std::string &  format)
virtual

Get a new dynamically created IDiscreteDistribution object.

Parameters
formatThe input file format.
Returns
A pointer toward a new IDiscreteDistribution object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 11 of file IoDiscreteDistributionFactory.cpp.

References BPPO_FORMAT.

Referenced by ~IoDiscreteDistributionFactory().

◆ createWriter()

ODiscreteDistribution * IoDiscreteDistributionFactory::createWriter ( const std::string &  format)
virtual

Get a new dynamically created ODiscreteDistribution object.

Parameters
formatThe output file format.
Returns
A pointer toward a new ODiscreteDistribution object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 19 of file IoDiscreteDistributionFactory.cpp.

References BPPO_FORMAT.

Referenced by ~IoDiscreteDistributionFactory().

Member Data Documentation

◆ BPPO_FORMAT

const std::string IoDiscreteDistributionFactory::BPPO_FORMAT = "Bpp0"
static

Definition at line 25 of file IoDiscreteDistributionFactory.h.

Referenced by createReader(), and createWriter().


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