'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoError(3IV) .SH NAME SoError \(em error handling base class .SH INHERITS FROM SoError .SH SYNOPSIS .ps -1 \*(Cr#include .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crtypedef void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoErrorCB\*(Cr(const SoError *error, void *data) .sp .in 1i \f1Methods from class SoError: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHandlerCallback\*(Cr(SoErrorCB *cb, void *data) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoErrorCB * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHandlerCallback\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic void * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHandlerData\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst SbString & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDebugString\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassTypeId\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTypeId\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisOfType\*(Cr(SoType type) const .sp .SH DESCRIPTION \*(CbSoError\f1 is the base class for all error classes, which provide error handling for applications. There are two facets to errors: posting and handling. An error is posted when some bad condition occurs. Posting \&is done primarily by the Inventor library itself, but extenders can post their own errors. Posting an error creates an instance of the appropriate error class (or subclass) and then passes it to the active \&error handler. The default handler just prints an appropriate message to stderr. Applications can override this behavior by supplying a different handler (by specifying a callback function). .sp Each subclass \&of SoError supports the \*(CbsetHandlerCallback()\f1 method, which is used to set the callback function to handle errors. The callback function for a specfic error class is always used in preference to that of any base classes when handling \&errors. The error instance passed to a callback is deleted immediately after the callback is called; an application that wishes to save information from the instance has to copy it out first. .sp Each error \&class contains a run-time class type id (\*(CbSoType\f1) that can be used to determine the type of an instance. The base class defines a character string that represents a detailed error message that is printed by the \&default handler. All handlers are called by the \*(CbSoError::handleError()\f1 method. When debugging, you can set a breakpoint on this method to stop right before an error is handled. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic void .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHandlerCallback\*(Cr(SoErrorCB *cb, void *data) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoErrorCB * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHandlerCallback\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic void * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetHandlerData\*(Cr() .br .in 1i \f1Sets/returns handler callback for \*(CbSoError\f1 class. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crconst SbString & .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDebugString\*(Cr() const .br .in 1i \f1Returns debug string containing full error information from instance. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetClassTypeId\*(Cr() .br .in 1i \f1Returns type identifier for SoError class. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvirtual SoType .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetTypeId\*(Cr() const .br .in 1i \f1Returns type identifier for error instance. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisOfType\*(Cr(SoType type) const .br .in 1i \f1Returns TRUE if instance is of given type or is derived from it. .sp .in 0.5i .SH SEE ALSO \*(CbSoDebugError, SoMemoryError, SoReadError