Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IndexOutOfRangeException Class Reference

Exception when a value is not within a given range. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/base/arccore/base/IndexOutOfRangeException.h>

Inheritance diagram for Arcane::IndexOutOfRangeException:
Collaboration diagram for Arcane::IndexOutOfRangeException:

Public Member Functions

 IndexOutOfRangeException (const TraceInfo &where, const String &message, Int64 index, Int64 min_value_inclusive, Int64 max_value_exclusive)
void explain (std::ostream &m) const override
 Explains the cause of the exception in the stream o.
Int64 index () const
 Index.
Int64 minValue () const
 Valid minimum value (inclusive).
Int64 maxValue () const
 Valid maximum value (exclusive).
Public Member Functions inherited from Arcane::Exception
Exceptionoperator= (const Exception &)=delete
 Exception (const String &name, const String &where)
 Exception (const String &name, const TraceInfo &where)
 Exception (const String &name, const String &awhere, const String &message)
 Exception (const String &name, const TraceInfo &trace, const String &message)
 Exception (const String &name, const String &where, const StackTrace &stack_trace)
 Exception (const String &name, const TraceInfo &where, const StackTrace &stack_trace)
 Exception (const String &name, const String &where, const String &message, const StackTrace &stack_trace)
 Exception (const String &name, const TraceInfo &trace, const String &message, const StackTrace &stack_trace)
 Exception (const Exception &)
 Copy constructor.
 ~Exception () ARCCORE_NOEXCEPT override
 Releases resources.
virtual void write (std::ostream &o) const
bool isCollective () const
 True if it is a collective error (concerns all processors).
void setCollective (bool v)
 Sets the collective state of the expression.
void setAdditionalInfo (const String &v)
 Sets the additional information.
const StringadditionalInfo () const
 Returns the additional information.
const StackTracestackTrace () const
 Call stack at the moment of the exception (requires a stacktrace service).
const StringstackTraceString () const
 Call stack at the moment of the exception (requires a stacktrace service).
const Stringmessage () const
 Exception message.
const Stringwhere () const
 Location of the exception.
const Stringname () const
 Name of the exception.

Private Attributes

Int64 m_index
Int64 m_min_value_inclusive
Int64 m_max_value_exclusive

Additional Inherited Members

Static Public Member Functions inherited from Arcane::Exception
static bool hasPendingException ()
 Indicates if there are pending exceptions.
static void staticInit ()
Protected Member Functions inherited from Arcane::Exception
void setMessage (const String &msg)
 Sets the exception message.

Detailed Description

Exception when a value is not within a given range.

Indicates that minValue() <= index() < maxValue() is not respected.

Definition at line 34 of file arccore/src/base/arccore/base/IndexOutOfRangeException.h.

Constructor & Destructor Documentation

◆ IndexOutOfRangeException()

Arcane::IndexOutOfRangeException::IndexOutOfRangeException ( const TraceInfo & where,
const String & message,
Int64 index,
Int64 min_value_inclusive,
Int64 max_value_exclusive )

Definition at line 27 of file IndexOutOfRangeException.cc.

Member Function Documentation

◆ explain()

void Arcane::IndexOutOfRangeException::explain ( std::ostream & o) const
overridevirtual

Explains the cause of the exception in the stream o.

This method allows adding additional information to the exception message.

Reimplemented from Arcane::Exception.

Definition at line 41 of file IndexOutOfRangeException.cc.

◆ index()

Int64 Arcane::IndexOutOfRangeException::index ( ) const
inline

◆ maxValue()

Int64 Arcane::IndexOutOfRangeException::maxValue ( ) const
inline

Valid maximum value (exclusive).

Definition at line 52 of file arccore/src/base/arccore/base/IndexOutOfRangeException.h.

◆ minValue()

Int64 Arcane::IndexOutOfRangeException::minValue ( ) const
inline

Valid minimum value (inclusive).

Definition at line 50 of file arccore/src/base/arccore/base/IndexOutOfRangeException.h.

Member Data Documentation

◆ m_index

Int64 Arcane::IndexOutOfRangeException::m_index
private

◆ m_max_value_exclusive

Int64 Arcane::IndexOutOfRangeException::m_max_value_exclusive
private

◆ m_min_value_inclusive

Int64 Arcane::IndexOutOfRangeException::m_min_value_inclusive
private

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