Open CASCADE Technology  7.3.1.dev
Public Member Functions | Static Public Member Functions | Protected Attributes
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 Standard_CString theMessage=0)
 Constructor is kept public for backward compatibility. More...
 
Standard_CString GetMessageString () const override
 Returns error message. More...
 
void SetMessageString (const Standard_CString aMessage) override
 Sets error message. More...
 

Static Public Member Functions

static void Raise (const Standard_CString theMessage="")
 Raises exception with specified message string. More...
 
static void Raise (Standard_SStream &theMessage)
 Raises exception with specified message string. More...
 
static Handle< Standard_OutOfMemoryNewInstance (const Standard_CString theMessage="")
 Returns global instance of exception. More...
 

Protected Attributes

char myBuffer [1024]
 

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 Standard_CString  theMessage = 0)

Constructor is kept public for backward compatibility.

Member Function Documentation

◆ GetMessageString()

Standard_CString Standard_OutOfMemory::GetMessageString ( ) const
override

Returns error message.

◆ NewInstance()

static Handle< Standard_OutOfMemory > Standard_OutOfMemory::NewInstance ( const Standard_CString  theMessage = "")
static

Returns global instance of exception.

◆ Raise() [1/2]

static void Standard_OutOfMemory::Raise ( const Standard_CString  theMessage = "")
static

Raises exception with specified message string.

◆ Raise() [2/2]

static void Standard_OutOfMemory::Raise ( Standard_SStream theMessage)
static

Raises exception with specified message string.

◆ SetMessageString()

void Standard_OutOfMemory::SetMessageString ( const Standard_CString  aMessage)
override

Sets error message.

Field Documentation

◆ myBuffer

char Standard_OutOfMemory::myBuffer[1024]
protected

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