bpp-phyl3  3.0.0
bpp::IOTreeFactory Class Reference

Utilitary class for creating tree readers and writers. More...

#include <Bpp/Phyl/Io/IoTreeFactory.h>

+ Collaboration diagram for bpp::IOTreeFactory:

Public Member Functions

 IOTreeFactory ()
 Creates a new factory object. More...
 
virtual ~IOTreeFactory ()
 
virtual ITreecreateReader (const std::string &format)
 Get a new dynamically created ITree object. More...
 
virtual OTreecreateWriter (const std::string &format)
 Get a new dynamically created OTree object. More...
 

Static Public Attributes

static const std::string NEWICK_FORMAT = "Newick"
 
static const std::string NEXUS_FORMAT = "Nexus"
 
static const std::string NHX_FORMAT = "Nhx"
 

Detailed Description

Utilitary class for creating tree readers and writers.

See also
IOSequenceFactory
IODistanceMatrixFactory

Definition at line 19 of file IoTreeFactory.h.

Constructor & Destructor Documentation

◆ IOTreeFactory()

bpp::IOTreeFactory::IOTreeFactory ( )
inline

Creates a new factory object.

Example:

ITree * treeReader = IOTreeFactory().createReader(IOTreeFactory::NEWICK);
Tree * tree = treeReader->read("file.dnd");
delete treeReader;
IOTreeFactory()
Creates a new factory object.
Definition: IoTreeFactory.h:37

Definition at line 37 of file IoTreeFactory.h.

◆ ~IOTreeFactory()

virtual bpp::IOTreeFactory::~IOTreeFactory ( )
inlinevirtual

Definition at line 38 of file IoTreeFactory.h.

Member Function Documentation

◆ createReader()

ITree * IOTreeFactory::createReader ( const std::string &  format)
virtual

Get a new dynamically created ITree object.

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

Definition at line 16 of file IoTreeFactory.cpp.

References NEWICK_FORMAT, NEXUS_FORMAT, and NHX_FORMAT.

◆ createWriter()

OTree * IOTreeFactory::createWriter ( const std::string &  format)
virtual

Get a new dynamically created OTree object.

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

Definition at line 28 of file IoTreeFactory.cpp.

References NEWICK_FORMAT, NEXUS_FORMAT, and NHX_FORMAT.

Member Data Documentation

◆ NEWICK_FORMAT

const std::string IOTreeFactory::NEWICK_FORMAT = "Newick"
static

Definition at line 22 of file IoTreeFactory.h.

Referenced by createReader(), and createWriter().

◆ NEXUS_FORMAT

const std::string IOTreeFactory::NEXUS_FORMAT = "Nexus"
static

Definition at line 23 of file IoTreeFactory.h.

Referenced by createReader(), and createWriter().

◆ NHX_FORMAT

const std::string IOTreeFactory::NHX_FORMAT = "Nhx"
static

Definition at line 24 of file IoTreeFactory.h.

Referenced by createReader(), and createWriter().


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