Cantera  3.1.0b1
Loading...
Searching...
No Matches
IndexError Class Reference

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

#include <ctexceptions.h>

Inheritance diagram for IndexError:
[legend]

Detailed Description

An array index is out of range.

Definition at line 171 of file ctexceptions.h.

Public Member Functions

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

Private Attributes

string arrayName_
 
size_t m_
 
size_t mmax_
 

Additional Inherited Members

- Static Public Member Functions inherited from CanteraError
static void setStackTraceDepth (int depth)
 Set the number of stack frames to include when a CanteraError is displayed.
 
- Protected Member Functions inherited from CanteraError
 CanteraError ()
 Protected default constructor discourages throwing errors containing no information.
 
 CanteraError (const string &procedure)
 Constructor used by derived classes that override getMessage()
 
- Protected Attributes inherited from CanteraError
string procedure_
 The name of the procedure where the exception occurred.
 
string formattedMessage_
 Formatted message returned by what()
 

Constructor & Destructor Documentation

◆ IndexError()

IndexError ( const string &  func,
const 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 185 of file ctexceptions.h.

◆ ~IndexError()

~IndexError ( )
throw (
)
inlineoverride

Definition at line 188 of file ctexceptions.h.

Member Function Documentation

◆ getMessage()

string getMessage ( ) const
overridevirtual

Method overridden by derived classes to format the error message.

Reimplemented from CanteraError.

Definition at line 73 of file ctexceptions.cpp.

◆ getClass()

string getClass ( ) const
inlineoverridevirtual

Method overridden by derived classes to indicate their type.

Reimplemented from CanteraError.

Definition at line 190 of file ctexceptions.h.

Member Data Documentation

◆ arrayName_

string arrayName_
private

Definition at line 195 of file ctexceptions.h.

◆ m_

size_t m_
private

Definition at line 196 of file ctexceptions.h.

◆ mmax_

size_t mmax_
private

Definition at line 196 of file ctexceptions.h.


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