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_
 

Detailed Description

Index out of bounds exception class.

Definition at line 131 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 111 of file Exceptions.cpp.

Member Function Documentation

◆ getBadIndex()

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

Definition at line 119 of file Exceptions.cpp.

References badIndex_.

◆ getBounds()

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

Get the bounds.

Definition at line 118 of file Exceptions.cpp.

References bounds_.

◆ message()

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

Access the message as a std::string.

Definition at line 79 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 78 of file Exceptions.cpp.

References bpp::Exception::message_.

Member Data Documentation

◆ badIndex_

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

Definition at line 134 of file Exceptions.h.

Referenced by getBadIndex().

◆ bounds_

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

Definition at line 135 of file Exceptions.h.

Referenced by getBounds().


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