Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoError Class Reference

The SoError class is the base class for all the error handling classes. More...

#include <Inventor/errors/SoError.h>

Inheritance diagram for SoError:
SoDebugError SoMemoryError SoReadError

Public Member Functions

virtual ~SoError ()
 
const SbStringgetDebugString (void) const
 
virtual SoType getTypeId (void) const
 
SbBool isOfType (const SoType type) const
 

Static Public Member Functions

static SoType getClassTypeId (void)
 
static SoErrorCB * getHandlerCallback (void)
 
static voidgetHandlerData (void)
 
static SbString getString (const SoEngine *const engine)
 
static SbString getString (const SoNode *const node)
 
static SbString getString (const SoPath *const path)
 
static void initClass (void)
 
static void initClasses (void)
 
static void post (const char *const format,...)
 
static void setHandlerCallback (SoErrorCB *const func, void *const data)
 

Protected Member Functions

void appendToDebugString (const char *const str)
 
virtual SoErrorCBPtr getHandler (void *&data) const
 
void handleError (void)
 
void setDebugString (const char *const str)
 

Static Protected Member Functions

static void defaultHandlerCB (const SoError *error, void *userdata)
 

Detailed Description

The SoError class is the base class for all the error handling classes.

The default error handler just prints messages on the standard error output channel, but this can be overridden by client applications.

Being able to override the default handler is useful when you want to collect error messages upon e.g. model import for later presentation of the messages to the user in any custom manner (like for instance in a GUI message box).

The SoError class is not designed to be particularly useful for "direct use". Within the Coin library it is only used through its subclasses.

Constructor & Destructor Documentation

◆ ~SoError()

SoError::~SoError ( )
inlinevirtual

The default destructor does nothing.

Member Function Documentation

◆ appendToDebugString()

void SoError::appendToDebugString ( const char *const str)
protected

Add str at the end of the currently stored debug string.

◆ defaultHandlerCB()

void SoError::defaultHandlerCB ( const SoError * error,
void * data )
staticprotected

Contains the default code for handling error strings.

Default treatment of an error message is to print it out on the standard error file handle.

◆ getClassTypeId()

SoType SoError::getClassTypeId ( void )
static

This static method returns the SoType for this class.

See also
getTypeId()

◆ getDebugString()

const SbString & SoError::getDebugString ( void ) const

This method returns an SbString containing error info from the given error instance.

◆ getHandler()

SoErrorCB * SoError::getHandler ( void *& data) const
protectedvirtual

This is just a convenience wrapper around the getHandlerCallback() and getHandlerData() methods.

Reimplemented in SoDebugError, SoMemoryError, and SoReadError.

◆ getHandlerCallback()

SoErrorCB * SoError::getHandlerCallback ( void )
static

Returns the error handler callback for messages posted via this class.

◆ getHandlerData()

void * SoError::getHandlerData ( void )
static

This method returns the pointer used for passing data back to the callback handler method.

◆ getString() [1/3]

SbString SoError::getString ( const SoEngine *const engine)
static

Constructs a string identifying the engine with name (if available) and memory pointer.

◆ getString() [2/3]

SbString SoError::getString ( const SoNode *const node)
static

Constructs a string identifying the node with name (if available) and memory pointer.

◆ getString() [3/3]

SbString SoError::getString ( const SoPath *const path)
static

Constructs a string identifying the path with name (if available) and memory pointer.

◆ getTypeId()

SoType SoError::getTypeId ( void ) const
virtual

This method returns the SoType of a particular object instance.

See also
getClassTypeId()

Reimplemented in SoDebugError, SoMemoryError, and SoReadError.

◆ handleError()

void SoError::handleError ( void )
protected

This method calls the appropriate handler for an error instance. All error handling goes through this method, and is therefore a good candidate for a debugger breakpoint.

◆ initClass()

void SoError::initClass ( void )
static

This method takes care of initializing all static data for the class.

◆ initClasses()

void SoError::initClasses ( void )
static

This static method initializes all the SoError classes.

◆ isOfType()

SbBool SoError::isOfType ( const SoType type) const

This method returns TRUE if the error instance is of - or derived from - type, and FALSE otherwise.

◆ post()

void SoError::post ( const char *const format,
... )
static

This method posts an error message. The format string and the trailing arguments should follow the printf() standard.

◆ setDebugString()

void SoError::setDebugString ( const char *const str)
protected

Replace the latest stored debug string with str.

◆ setHandlerCallback()

void SoError::setHandlerCallback ( SoErrorCB *const function,
void *const data )
static

This method sets the error handler callback for messages posted via this class.

Note that this will not override the error/debug message handler for subclasses, these will have to be overridden by calling the subclass' setHandlerCallback() method.

See also
defaultHandlerCB()

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