bpp-core3  3.0.0
bpp::IndexOutOfBoundsException Class Reference

Index out of bounds exception class. More...

#include <Bpp/Exceptions.h>

+ Inheritance diagram for bpp::IndexOutOfBoundsException:
+ Collaboration diagram for bpp::IndexOutOfBoundsException:

Public Member Functions

 IndexOutOfBoundsException (std::string text, std::size_t badInt, std::size_t lowerBound, std::size_t upperBound)
 Build a new IndexOutOfBoundsException. More...
 
const std::array< std::size_t, 2 > & getBounds () const
 Get the bounds. More...
 
std::size_t getBadIndex () 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...
 

Private Attributes

std::size_t badIndex_
 
std::array< std::size_t, 2 > bounds_
 
std::string message_
 

Detailed Description

Index out of bounds exception class.

Definition at line 169 of file Exceptions.h.

Constructor & Destructor Documentation

◆ IndexOutOfBoundsException()

bpp::IndexOutOfBoundsException::IndexOutOfBoundsException ( std::string  text,
std::size_t  badInt,
std::size_t  lowerBound,
std::size_t  upperBound 
)

Build a new IndexOutOfBoundsException.

Parameters
textA message to be passed to the exception hierarchy.
badIntThe faulty integer.
lowerBoundLower limit.
upperBoundUpper limit.

Definition at line 151 of file Exceptions.cpp.

Member Function Documentation

◆ getBadIndex()

std::size_t bpp::IndexOutOfBoundsException::getBadIndex ( ) const

Definition at line 159 of file Exceptions.cpp.

◆ getBounds()

const std::array< std::size_t, 2 > & bpp::IndexOutOfBoundsException::getBounds ( ) const

Get the bounds.

Definition at line 158 of file Exceptions.cpp.

◆ 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_.

◆ 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

◆ badIndex_

std::size_t bpp::IndexOutOfBoundsException::badIndex_
private

Definition at line 172 of file Exceptions.h.

◆ bounds_

std::array<std::size_t, 2> bpp::IndexOutOfBoundsException::bounds_
private

Definition at line 173 of file Exceptions.h.

◆ message_

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

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