bpp-popgen  3.0.0
bpp::AnalyzedSequences Class Reference

The AnalyzedSequences class. More...

#include <Bpp/PopGen/DataSet/AnalyzedSequences.h>

+ Collaboration diagram for bpp::AnalyzedSequences:

Public Member Functions

 AnalyzedSequences ()
 
 AnalyzedSequences (const Alphabet *alpha)
 
 ~AnalyzedSequences ()
 
 AnalyzedSequences (const AnalyzedSequences &as)
 
AnalyzedSequencesoperator= (const AnalyzedSequences &as)
 
void setAlphabet (const Alphabet *alpha)
 Set the alphabet used for the sequences. More...
 
void setAlphabet (const std::string &alpha_type)
 Set the alphabet used for the sequences by alphabet type. More...
 
const AlphabetgetAlphabet () const
 Get the alphabet. More...
 
std::string getAlphabetType () const
 Get the alphabet type as a string. More...
 

Private Member Functions

void clear_ ()
 

Private Attributes

const Alphabetalphabet_
 
bool autoset_
 

Detailed Description

The AnalyzedSequences class.

This is a class to store info about the sequences.

The object stores a pointer toward a const Alphabet. The way the pointer is managed depend on the method used to set it.

If one use a method using a const Alphabet* to set the Alphabet, then he has to take care of the memory management (i.e. freeing the Alphabet object).

If one use a method that create an Alphabet object like those using a string description of the Alphabet then the AnalyzedSequences object will delete himself the Alphabet object on destruction.

Be carefull when copying an AnalyzedSequences object, the way that the Alphabet object is managed is also copyed then if the initial AnalyzedSequences takes care of its Alphabet member then the copy will hold copy af the Alphabet an manage it else the new AnalyzedSequences will just copy the pointer and it's up to the user to take care of its deletion.

Author
Sylvain Gaillard

Definition at line 73 of file AnalyzedSequences.h.

Constructor & Destructor Documentation

◆ AnalyzedSequences() [1/3]

AnalyzedSequences::AnalyzedSequences ( )

Definition at line 48 of file AnalyzedSequences.cpp.

◆ AnalyzedSequences() [2/3]

AnalyzedSequences::AnalyzedSequences ( const Alphabet alpha)

Definition at line 51 of file AnalyzedSequences.cpp.

◆ ~AnalyzedSequences()

AnalyzedSequences::~AnalyzedSequences ( )

Definition at line 54 of file AnalyzedSequences.cpp.

References clear_().

◆ AnalyzedSequences() [3/3]

AnalyzedSequences::AnalyzedSequences ( const AnalyzedSequences as)

Definition at line 59 of file AnalyzedSequences.cpp.

References alphabet_, autoset_, getAlphabetType(), and setAlphabet().

Member Function Documentation

◆ clear_()

void AnalyzedSequences::clear_ ( )
private

Definition at line 120 of file AnalyzedSequences.cpp.

References alphabet_, and autoset_.

Referenced by ~AnalyzedSequences().

◆ getAlphabet()

const Alphabet* bpp::AnalyzedSequences::getAlphabet ( ) const
inline

Get the alphabet.

Definition at line 103 of file AnalyzedSequences.h.

References alphabet_.

Referenced by bpp::DataSet::getAlphabet().

◆ getAlphabetType()

std::string AnalyzedSequences::getAlphabetType ( ) const

Get the alphabet type as a string.

Definition at line 108 of file AnalyzedSequences.cpp.

References alphabet_, and bpp::Alphabet::getAlphabetType().

Referenced by AnalyzedSequences(), bpp::DataSet::getAlphabetType(), and operator=().

◆ operator=()

AnalyzedSequences & AnalyzedSequences::operator= ( const AnalyzedSequences as)

Definition at line 73 of file AnalyzedSequences.cpp.

References alphabet_, autoset_, getAlphabetType(), and setAlphabet().

◆ setAlphabet() [1/2]

void AnalyzedSequences::setAlphabet ( const Alphabet alpha)

Set the alphabet used for the sequences.

Definition at line 87 of file AnalyzedSequences.cpp.

References alphabet_, and autoset_.

Referenced by AnalyzedSequences(), operator=(), and bpp::DataSet::setAlphabet().

◆ setAlphabet() [2/2]

void AnalyzedSequences::setAlphabet ( const std::string &  alpha_type)

Set the alphabet used for the sequences by alphabet type.

Definition at line 93 of file AnalyzedSequences.cpp.

References alphabet_, and autoset_.

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AnalyzedSequences::alphabet_
private

◆ autoset_

bool bpp::AnalyzedSequences::autoset_
private

Definition at line 77 of file AnalyzedSequences.h.

Referenced by AnalyzedSequences(), clear_(), operator=(), and setAlphabet().


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