bpp-phyl  2.2.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) throw (Exception)
 Get a new dynamically created ITree object. More...
 
virtual OTreecreateWriter (const std::string &format) throw (Exception)
 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 54 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;

Definition at line 73 of file IoTreeFactory.h.

◆ ~IOTreeFactory()

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

Definition at line 74 of file IoTreeFactory.h.

Member Function Documentation

◆ createReader()

ITree * IOTreeFactory::createReader ( const std::string &  format)
throw (Exception
)
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 51 of file IoTreeFactory.cpp.

◆ createWriter()

OTree * IOTreeFactory::createWriter ( const std::string &  format)
throw (Exception
)
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 59 of file IoTreeFactory.cpp.

Member Data Documentation

◆ NEWICK_FORMAT

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

Definition at line 57 of file IoTreeFactory.h.

◆ NEXUS_FORMAT

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

Definition at line 58 of file IoTreeFactory.h.

◆ NHX_FORMAT

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

Definition at line 59 of file IoTreeFactory.h.


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