Cantera 2.6.0
Public Member Functions | Private Attributes | List of all members
IndexError Class Reference

An array index is out of range. More...

#include <ctexceptions.h>

Inheritance diagram for IndexError:
[legend]
Collaboration diagram for IndexError:
[legend]

Public Member Functions

 IndexError (const std::string &func, const std::string &arrayName, size_t m, size_t mmax)
 Constructor. More...
 
virtual std::string getMessage () const
 Method overridden by derived classes to format the error message. More...
 
virtual std::string getClass () const
 Method overridden by derived classes to indicate their type. More...
 
- Public Member Functions inherited from CanteraError
template<typename... Args>
 CanteraError (const std::string &procedure, const std::string &msg, const Args &... args)
 Normal Constructor for the CanteraError base class. More...
 
virtual ~CanteraError () throw ()
 Destructor for base class does nothing. More...
 
const char * what () const throw ()
 Get a description of the error. More...
 

Private Attributes

std::string arrayName_
 
size_t m_
 
size_t mmax_
 

Additional Inherited Members

- Protected Member Functions inherited from CanteraError
 CanteraError ()
 Protected default constructor discourages throwing errors containing no information. More...
 
 CanteraError (const std::string &procedure)
 Constructor used by derived classes that override getMessage() More...
 
- Protected Attributes inherited from CanteraError
std::string procedure_
 The name of the procedure where the exception occurred. More...
 
std::string formattedMessage_
 Formatted message returned by what() More...
 

Detailed Description

An array index is out of range.

Definition at line 157 of file ctexceptions.h.

Constructor & Destructor Documentation

◆ IndexError()

IndexError ( const std::string &  func,
const std::string &  arrayName,
size_t  m,
size_t  mmax 
)
inline

Constructor.

This class indicates an out-of-bounds array index.

Parameters
funcString name for the function within which the error was generated.
arrayNamename of the corresponding array
mThis is the value of the out-of-bounds index.
mmaxThis is the maximum allowed value of the index. The minimum allowed value is assumed to be 0.

Definition at line 171 of file ctexceptions.h.

◆ ~IndexError()

virtual ~IndexError ( )
throw (
)
inlinevirtual

Definition at line 174 of file ctexceptions.h.

Member Function Documentation

◆ getMessage()

std::string getMessage ( ) const
virtual

Method overridden by derived classes to format the error message.

Reimplemented from CanteraError.

Definition at line 56 of file ctexceptions.cpp.

◆ getClass()

virtual std::string getClass ( ) const
inlinevirtual

Method overridden by derived classes to indicate their type.

Reimplemented from CanteraError.

Definition at line 176 of file ctexceptions.h.

Member Data Documentation

◆ arrayName_

std::string arrayName_
private

Definition at line 181 of file ctexceptions.h.

◆ m_

size_t m_
private

Definition at line 182 of file ctexceptions.h.

◆ mmax_

size_t mmax_
private

Definition at line 182 of file ctexceptions.h.


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