bpp-seq3  3.0.0
bpp::BadCharException Class Reference

An alphabet exception thrown when trying to specify a bad char to the alphabet. More...

#include <Bpp/Seq/Alphabet/AlphabetExceptions.h>

+ Inheritance diagram for bpp::BadCharException:
+ Collaboration diagram for bpp::BadCharException:

Public Member Functions

 BadCharException (const std::string &badChar, const std::string &text, const Alphabet *alpha)
 Build a new BadCharException. More...
 
 BadCharException (const std::string &badChar, const std::string &text, std::shared_ptr< const Alphabet > alpha)
 Build a new BadCharException. More...
 
virtual ~BadCharException ()
 
virtual std::string getBadChar () const
 Get the character that threw the exception. More...
 
virtual const AlphabetgetAlphabet () const
 Get the alphabet that threw the exception. More...
 
const char * what () const noexcept override
 
const std::string & message () const noexcept
 

Protected Attributes

std::string c_
 

Private Attributes

const Alphabetalphabet_
 
std::string message_
 

Detailed Description

An alphabet exception thrown when trying to specify a bad char to the alphabet.

Definition at line 71 of file AlphabetExceptions.h.

Constructor & Destructor Documentation

◆ BadCharException() [1/2]

BadCharException::BadCharException ( const std::string &  badChar,
const std::string &  text,
const Alphabet alpha 
)

Build a new BadCharException.

Parameters
badCharThe faulty character.
textA message to be passed to the exception hierarchy.
alphaA const pointer toward the alphabet that threw the exception.

Definition at line 28 of file AlphabetExceptions.cpp.

◆ BadCharException() [2/2]

BadCharException::BadCharException ( const std::string &  badChar,
const std::string &  text,
std::shared_ptr< const Alphabet alpha 
)

Build a new BadCharException.

Parameters
badCharThe faulty character.
textA message to be passed to the exception hierarchy.
alphaA const pointer toward the alphabet that threw the exception.

Definition at line 32 of file AlphabetExceptions.cpp.

◆ ~BadCharException()

virtual bpp::BadCharException::~BadCharException ( )
inlinevirtual

Definition at line 96 of file AlphabetExceptions.h.

Member Function Documentation

◆ getAlphabet()

virtual const Alphabet* bpp::AlphabetException::getAlphabet ( ) const
inlinevirtualinherited

Get the alphabet that threw the exception.

Returns
a const pointer toward the alphabet.

Definition at line 65 of file AlphabetExceptions.h.

References bpp::AlphabetException::alphabet_.

◆ getBadChar()

string BadCharException::getBadChar ( ) const
virtual

Get the character that threw the exception.

Returns
the faulty character.

Definition at line 36 of file AlphabetExceptions.cpp.

References c_.

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AlphabetException::alphabet_
privateinherited

◆ c_

std::string bpp::BadCharException::c_
protected

Definition at line 75 of file AlphabetExceptions.h.

Referenced by getBadChar().


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