bpp-core3  3.0.0
bpp::ElementNotFoundException< T > Class Template Reference

Exception thrown when a given element was not found in the vector. More...

#include <Bpp/Numeric/VectorExceptions.h>

+ Inheritance diagram for bpp::ElementNotFoundException< T >:
+ Collaboration diagram for bpp::ElementNotFoundException< T >:

Public Member Functions

 ElementNotFoundException (const std::string &text, const std::vector< T > *vect=nullptr, const T *element=nullptr)
 
 ElementNotFoundException (const ElementNotFoundException &)=default
 
ElementNotFoundExceptionoperator= (const ElementNotFoundException &)=default
 
const T * getElement () const
 
const std::vector< T > * getVector () const
 
const char * what () const noexcept override
 Method to get the message of the exception (STL method redefinition). More...
 
const std::string & message () const noexcept
 Access the message as a std::string. More...
 

Protected Attributes

const std::vector< T > * vect_
 

Private Attributes

const T * element_
 
std::string message_
 

Detailed Description

template<class T>
class bpp::ElementNotFoundException< T >

Exception thrown when a given element was not found in the vector.

Definition at line 99 of file VectorExceptions.h.

Constructor & Destructor Documentation

◆ ElementNotFoundException() [1/2]

template<class T >
bpp::ElementNotFoundException< T >::ElementNotFoundException ( const std::string &  text,
const std::vector< T > *  vect = nullptr,
const T *  element = nullptr 
)
inline

Definition at line 105 of file VectorExceptions.h.

◆ ElementNotFoundException() [2/2]

template<class T >
bpp::ElementNotFoundException< T >::ElementNotFoundException ( const ElementNotFoundException< T > &  )
default

Member Function Documentation

◆ getElement()

template<class T >
const T* bpp::ElementNotFoundException< T >::getElement ( ) const
inline

◆ getVector()

template<class T >
const std::vector<T>* bpp::VectorException< T >::getVector ( ) const
inlineinherited

Definition at line 67 of file VectorExceptions.h.

References bpp::VectorException< T >::vect_.

◆ message()

const std::string & bpp::Exception::message ( ) const
noexceptinherited

Access the message as a std::string.

Definition at line 119 of file Exceptions.cpp.

References bpp::Exception::message_.

◆ operator=()

template<class T >
ElementNotFoundException& bpp::ElementNotFoundException< T >::operator= ( const ElementNotFoundException< T > &  )
default

◆ what()

const char * bpp::Exception::what ( ) const
overridenoexceptinherited

Method to get the message of the exception (STL method redefinition).

Returns
The message passed to the exception hierarchy.

Definition at line 118 of file Exceptions.cpp.

References bpp::Exception::message_.

Member Data Documentation

◆ element_

template<class T >
const T* bpp::ElementNotFoundException< T >::element_
private

Definition at line 102 of file VectorExceptions.h.

Referenced by bpp::ElementNotFoundException< T >::getElement().

◆ message_

std::string bpp::Exception::message_
privateinherited

◆ vect_

template<class T >
const std::vector<T>* bpp::VectorException< T >::vect_
protectedinherited

Definition at line 58 of file VectorExceptions.h.

Referenced by bpp::VectorException< T >::getVector().


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