bpp-core  2.2.0
bpp::BppODiscreteDistributionFormat Class Reference

Discrete Distribution I/O in BppO format. More...

#include <Bpp/Io/BppODiscreteDistributionFormat.h>

+ Inheritance diagram for bpp::BppODiscreteDistributionFormat:
+ Collaboration diagram for bpp::BppODiscreteDistributionFormat:

Public Member Functions

 BppODiscreteDistributionFormat (bool verbose=true)
 
virtual ~BppODiscreteDistributionFormat ()
 
const std::string getFormatName () const
 Get the name of the file format. More...
 
const std::string getFormatDescription () const
 Get a description of the file format. More...
 
DiscreteDistributionread (const std::string &distDescription, bool parseArguments=true)
 Read a discrete distribution from a string. More...
 
const std::map< std::string, std::string > & getUnparsedArguments () const
 
void write (const DiscreteDistribution &dist, OutputStream &out, std::map< std::string, std::string > &globalAliases, std::vector< std::string > &writtenNames) const
 Write a discrete distribution to a stream. More...
 
virtual const std::string getDataType () const
 Get the type of data this format deals with. More...
 

Protected Member Functions

void initialize_ (DiscreteDistribution &rDist) throw (Exception)
 Set parameter initial values of a given distribution according to options. More...
 

Protected Attributes

bool verbose_
 
std::map< std::string, std::string > unparsedArguments_
 

Detailed Description

Discrete Distribution I/O in BppO format.

Creates a new discrete distribution object according to distribution description syntax (see the Bio++ Progam Suite manual for a detailed description of this syntax).

Definition at line 55 of file BppODiscreteDistributionFormat.h.

Constructor & Destructor Documentation

◆ BppODiscreteDistributionFormat()

bpp::BppODiscreteDistributionFormat::BppODiscreteDistributionFormat ( bool  verbose = true)
inline

Definition at line 64 of file BppODiscreteDistributionFormat.h.

◆ ~BppODiscreteDistributionFormat()

virtual bpp::BppODiscreteDistributionFormat::~BppODiscreteDistributionFormat ( )
inlinevirtual

Definition at line 65 of file BppODiscreteDistributionFormat.h.

Member Function Documentation

◆ getDataType()

virtual const std::string bpp::IoDiscreteDistribution::getDataType ( ) const
inlinevirtualinherited

Get the type of data this format deals with.

Returns
The type of data.

Implements bpp::IOFormat.

Definition at line 61 of file IoDiscreteDistribution.h.

◆ getFormatDescription()

const std::string bpp::BppODiscreteDistributionFormat::getFormatDescription ( ) const
inlinevirtual

Get a description of the file format.

Returns
A description of the format implemented.

Implements bpp::IOFormat.

Definition at line 70 of file BppODiscreteDistributionFormat.h.

◆ getFormatName()

const std::string bpp::BppODiscreteDistributionFormat::getFormatName ( ) const
inlinevirtual

Get the name of the file format.

Returns
The name of the format implemented.

Implements bpp::IOFormat.

Definition at line 68 of file BppODiscreteDistributionFormat.h.

◆ getUnparsedArguments()

const std::map<std::string, std::string>& bpp::BppODiscreteDistributionFormat::getUnparsedArguments ( ) const
inlinevirtual
Returns
The arguments and their unparsed values from the last call of the read function, if there are any.

Implements bpp::IDiscreteDistribution.

Definition at line 74 of file BppODiscreteDistributionFormat.h.

References unparsedArguments_.

Referenced by read().

◆ initialize_()

void BppODiscreteDistributionFormat::initialize_ ( DiscreteDistribution rDist)
throw (Exception
)
protected

Set parameter initial values of a given distribution according to options.

Parameters actually depends on the distribution passed as argument.

Parameters
rDistThe distribution to set up.
Exceptions
Exceptionif an error occured.

Definition at line 406 of file BppODiscreteDistributionFormat.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getDoubleParameter(), bpp::AutoParameter::setMessageHandler(), bpp::ParameterList::setParameter(), bpp::ParameterList::size(), bpp::TextTools::toString(), and bpp::ApplicationTools::warning.

◆ read()

DiscreteDistribution * BppODiscreteDistributionFormat::read ( const std::string &  distrDescription,
bool  parseArguments = true 
)
virtual

Read a discrete distribution from a string.

Parameters
distrDescriptionA string describing the distribution in the format.
parseArgumentsAttempt to parse function arguments. If not, only store them and use default values instead.
Returns
A new DiscreteDistribution object according to options specified.
Exceptions
Exceptionif an error occured.

Implements bpp::IDiscreteDistribution.

Definition at line 69 of file BppODiscreteDistributionFormat.cpp.

References bpp::ApplicationTools::displayResult(), bpp::DiscreteDistribution::getNumberOfCategories(), bpp::ParameterList::getParameterNames(), bpp::Parametrizable::getParameterNameWithoutNamespace(), bpp::Parametrizable::getParameters(), bpp::Parametrizable::getParameterValue(), getUnparsedArguments(), bpp::StringTokenizer::hasMoreToken(), bpp::TextTools::isEmpty(), bpp::StringTokenizer::nextToken(), bpp::KeyvalTools::parseProcedure(), read(), bpp::DiscreteDistribution::setMedian(), bpp::TextTools::toDouble(), bpp::TextTools::toInt(), and bpp::TextTools::toString().

Referenced by read().

◆ write()

Member Data Documentation

◆ unparsedArguments_

std::map<std::string, std::string> bpp::BppODiscreteDistributionFormat::unparsedArguments_
protected

Definition at line 61 of file BppODiscreteDistributionFormat.h.

Referenced by getUnparsedArguments().

◆ verbose_

bool bpp::BppODiscreteDistributionFormat::verbose_
protected

Definition at line 60 of file BppODiscreteDistributionFormat.h.


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