SYNOPSIS

#include <Inventor/errors/SoError.h>

Inherited by SoDebugError, SoMemoryError, and SoReadError.

Public Member Functions

virtual ~SoError ()

const SbString & getDebugString (void) const

virtual SoType getTypeId (void) const

SbBool isOfType (const SoType type) const

Static Public Member Functions

static void setHandlerCallback (SoErrorCB *const func, void *const data)

static SoErrorCB * getHandlerCallback (void)

static void * getHandlerData (void)

static SoType getClassTypeId (void)

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

static SbString getString (const SoNode *const node)

static SbString getString (const SoPath *const path)

static SbString getString (const SoEngine *const engine)

static void initClass (void)

static void initClasses (void)

Protected Member Functions

virtual SoErrorCBPtr getHandler (void *&data) const

void setDebugString (const char *const str)

void appendToDebugString (const char *const str)

void handleError (void)

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 messagebox).

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 ()\fC [inline]\fP, \fC [virtual]\fP

The default destructor does nothing.

Member Function Documentation

void SoError::setHandlerCallback (SoErrorCB *constfunction, void *constdata)\fC [static]\fP

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 overrided by calling the subclass' setHandlerCallback() method.

See also:

defaultHandlerCB()

SoErrorCB * SoError::getHandlerCallback (void)\fC [static]\fP

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

void * SoError::getHandlerData (void)\fC [static]\fP

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

const \fBSbString\fP & SoError::getDebugString (void) const

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

\fBSoType\fP SoError::getClassTypeId (void)\fC [static]\fP

This static method returns the SoType for this class.

See also:

getTypeId()

\fBSoType\fP SoError::getTypeId (void) const\fC [virtual]\fP

This method returns the SoType of a particular object instance.

See also:

getClassTypeId()

Reimplemented in SoDebugError, SoReadError, and SoMemoryError.

SbBool SoError::isOfType (const \fBSoType\fPtype) const

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

void SoError::post (const char *constformat, ...)\fC [static]\fP

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

\fBSbString\fP SoError::getString (const \fBSoNode\fP *constnode)\fC [static]\fP

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

\fBSbString\fP SoError::getString (const \fBSoPath\fP *constpath)\fC [static]\fP

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

\fBSbString\fP SoError::getString (const \fBSoEngine\fP *constengine)\fC [static]\fP

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

void SoError::initClass (void)\fC [static]\fP

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

void SoError::initClasses (void)\fC [static]\fP

This static method initializes all the SoError classes.

void SoError::defaultHandlerCB (const \fBSoError\fP *error, void *data)\fC [static]\fP, \fC [protected]\fP

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.

SoErrorCB * SoError::getHandler (void *&data) const\fC [protected]\fP, \fC [virtual]\fP

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

Reimplemented in SoDebugError, SoReadError, and SoMemoryError.

void SoError::setDebugString (const char *conststr)\fC [protected]\fP

Replace the latest stored debug string with str.

void SoError::appendToDebugString (const char *conststr)\fC [protected]\fP

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

void SoError::handleError (void)\fC [protected]\fP

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.

Author

Generated automatically by Doxygen for Coin from the source code.