Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Standard_OutOfMemory Class Reference

Standard_OutOfMemory exception is defined explicitly and not by macro DEFINE_STANDARD_EXCEPTION, to avoid necessity of dynamic memory allocations during throwing and stack unwinding: More...

#include <Standard_OutOfMemory.hxx>

Inheritance diagram for Standard_OutOfMemory:
Inheritance graph
[legend]

Public Member Functions

 Standard_OutOfMemory (const char *const theMessage=nullptr)
 Constructor is kept public for backward compatibility.
 
const charwhat () const noexcept override
 Returns error message (implements std::exception interface).
 
const charExceptionType () const noexcept override
 Returns the exception type name.
 
void SetMessageString (const char *const theMessage)
 Sets error message.
 

Detailed Description

Standard_OutOfMemory exception is defined explicitly and not by macro DEFINE_STANDARD_EXCEPTION, to avoid necessity of dynamic memory allocations during throwing and stack unwinding:

The reason is that in out-of-memory condition any memory allocation can fail, thus use of operator new for allocation of new exception instance is dangerous (can cause recursion until stack overflow, see #24836).

Constructor & Destructor Documentation

◆ Standard_OutOfMemory()

Standard_OutOfMemory::Standard_OutOfMemory ( const char *const theMessage = nullptr)

Constructor is kept public for backward compatibility.

Parameters
theMessageoptional error message

Member Function Documentation

◆ ExceptionType()

const char * Standard_OutOfMemory::ExceptionType ( ) const
inlineoverridenoexcept

Returns the exception type name.

◆ SetMessageString()

void Standard_OutOfMemory::SetMessageString ( const char *const theMessage)

Sets error message.

Parameters
theMessageerror message (can be nullptr)

◆ what()

const char * Standard_OutOfMemory::what ( ) const
overridenoexcept

Returns error message (implements std::exception interface).


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