bpp-seq3  3.0.0
bpp::AlphabetMismatchException Class Reference

Exception thrown when two alphabets do not match. More...

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

+ Inheritance diagram for bpp::AlphabetMismatchException:
+ Collaboration diagram for bpp::AlphabetMismatchException:

Public Member Functions

 AlphabetMismatchException (const std::string &text, const Alphabet *alpha1, const Alphabet *alpha2)
 Build a new AlphabetMismatchException object. More...
 
 AlphabetMismatchException (const std::string &text, std::shared_ptr< const Alphabet > alpha1, std::shared_ptr< const Alphabet > alpha2)
 Build a new AlphabetMismatchException object. More...
 
 AlphabetMismatchException (const AlphabetMismatchException &ame)
 
AlphabetMismatchExceptionoperator= (const AlphabetMismatchException &ame)
 
virtual ~AlphabetMismatchException ()
 
const AlphabetgetFirstAlphabet () const
 Get the first alphabet. More...
 
const AlphabetgetSecondAlphabet () const
 Get the second alphabet. More...
 
const char * what () const noexcept override
 
const std::string & message () const noexcept
 

Private Attributes

const Alphabetalphabet1_
 
const Alphabetalphabet2_
 
std::string message_
 

Detailed Description

Exception thrown when two alphabets do not match.

Typically, this may occur when you try to add a bad sequence to a container, or concatenate two kinds of sequences, and so on.

Definition at line 150 of file AlphabetExceptions.h.

Constructor & Destructor Documentation

◆ AlphabetMismatchException() [1/3]

AlphabetMismatchException::AlphabetMismatchException ( const std::string &  text,
const Alphabet alpha1,
const Alphabet alpha2 
)

Build a new AlphabetMismatchException object.

Parameters
textA message to be passed to the exception hierarchy.
alpha1A const pointer toward the first alphabet.
alpha2A const pointer toward the second alphabet, i.e. the one which does not match with the first.

Definition at line 52 of file AlphabetExceptions.cpp.

◆ AlphabetMismatchException() [2/3]

AlphabetMismatchException::AlphabetMismatchException ( const std::string &  text,
std::shared_ptr< const Alphabet alpha1,
std::shared_ptr< const Alphabet alpha2 
)

Build a new AlphabetMismatchException object.

Parameters
textA message to be passed to the exception hierarchy.
alpha1A const smart pointer toward the first alphabet.
alpha2A const smart pointer toward the second alphabet, i.e. the one which does not match with the first.

Definition at line 59 of file AlphabetExceptions.cpp.

◆ AlphabetMismatchException() [3/3]

bpp::AlphabetMismatchException::AlphabetMismatchException ( const AlphabetMismatchException ame)
inline

Definition at line 182 of file AlphabetExceptions.h.

◆ ~AlphabetMismatchException()

virtual bpp::AlphabetMismatchException::~AlphabetMismatchException ( )
inlinevirtual

Definition at line 197 of file AlphabetExceptions.h.

Member Function Documentation

◆ getFirstAlphabet()

const Alphabet* bpp::AlphabetMismatchException::getFirstAlphabet ( ) const
inline

Get the first alphabet.

Returns
A reference toward the first alphabet.

Definition at line 205 of file AlphabetExceptions.h.

References alphabet1_.

◆ getSecondAlphabet()

const Alphabet* bpp::AlphabetMismatchException::getSecondAlphabet ( ) const
inline

Get the second alphabet.

Returns
A reference toward the seocnd alphabet.

Definition at line 212 of file AlphabetExceptions.h.

References alphabet2_.

◆ operator=()

AlphabetMismatchException& bpp::AlphabetMismatchException::operator= ( const AlphabetMismatchException ame)
inline

Definition at line 188 of file AlphabetExceptions.h.

References alphabet1_, and alphabet2_.

Member Data Documentation

◆ alphabet1_

const Alphabet* bpp::AlphabetMismatchException::alphabet1_
private

Definition at line 154 of file AlphabetExceptions.h.

Referenced by getFirstAlphabet(), and operator=().

◆ alphabet2_

const Alphabet* bpp::AlphabetMismatchException::alphabet2_
private

Definition at line 155 of file AlphabetExceptions.h.

Referenced by getSecondAlphabet(), and operator=().


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