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

Exception in an assertion. More...

#include <arcane/core/ArcaneException.h>

Inheritance diagram for Arcane::AssertionException:
Collaboration diagram for Arcane::AssertionException:

Public Member Functions

 AssertionException (const TraceInfo &where)
 AssertionException (const TraceInfo &where, const String &expected, const String &actual)
void explain (std::ostream &m) const override
 Explains the cause of the exception in the stream o.
const char * file () const
 File of the exception.
int line () const
 Line of the exception.
const Stringmessage () const
 Exception message.
const Stringwhere () const
 Location of the exception.
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

const char * m_file
int m_line

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 in an assertion.

Definition at line 263 of file ArcaneException.h.

Constructor & Destructor Documentation

◆ AssertionException() [1/2]

Arcane::AssertionException::AssertionException ( const TraceInfo & where)
explicit

Constructs an exception originating from the function where.

Definition at line 269 of file ArcaneException.cc.

References Arcane::Exception::Exception(), file(), line(), and where().

Here is the call graph for this function:

◆ AssertionException() [2/2]

Arcane::AssertionException::AssertionException ( const TraceInfo & where,
const String & expected,
const String & actual )

Constructs an exception originating from the function where. The expected value in the assertion was expected, the obtained result was actual.

Definition at line 280 of file ArcaneException.cc.

References Arcane::Exception::Exception(), file(), line(), and where().

Here is the call graph for this function:

Member Function Documentation

◆ explain()

void Arcane::AssertionException::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 291 of file ArcaneException.cc.

◆ file()

const char * Arcane::AssertionException::file ( ) const
inline

File of the exception.

Definition at line 284 of file ArcaneException.h.

Referenced by AssertionException(), AssertionException(), and Arcane::UnitTestServiceAdapter< T >::executeTest().

Here is the caller graph for this function:

◆ line()

int Arcane::AssertionException::line ( ) const
inline

Line of the exception.

Definition at line 287 of file ArcaneException.h.

Referenced by AssertionException(), AssertionException(), and Arcane::UnitTestServiceAdapter< T >::executeTest().

Here is the caller graph for this function:

◆ message()

const String & Arcane::Exception::message ( ) const
inline

Exception message.

Definition at line 130 of file arccore/src/base/arccore/base/Exception.h.

Referenced by Arcane::UnitTestServiceAdapter< T >::executeTest().

Here is the caller graph for this function:

◆ where()

const String & Arcane::Exception::where ( ) const
inline

Location of the exception.

Definition at line 133 of file arccore/src/base/arccore/base/Exception.h.

Referenced by AssertionException(), AssertionException(), and Arcane::UnitTestServiceAdapter< T >::executeTest().

Here is the caller graph for this function:

Member Data Documentation

◆ m_file

const char* Arcane::AssertionException::m_file
private

Definition at line 296 of file ArcaneException.h.

◆ m_line

int Arcane::AssertionException::m_line
private

Definition at line 297 of file ArcaneException.h.


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