00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef COIN_SOERROR_H
00021
#define COIN_SOERROR_H
00022
00023
#include <Inventor/SbBasic.h>
00024
#include <Inventor/SbString.h>
00025
#include <Inventor/SoType.h>
00026
00027
class SoBase;
00028
class SoNode;
00029
class SoPath;
00030
class SoEngine;
00031
00032
typedef void SoErrorCB(
const class SoError * error,
void * data);
00033
00034
00035 class COIN_DLL_API SoError {
00036
public:
00037
static void setHandlerCallback(SoErrorCB *
const func,
void *
const data);
00038
static SoErrorCB * getHandlerCallback(
void);
00039
static void * getHandlerData(
void);
00040
00041
const SbString & getDebugString(
void)
const;
00042
00043
static SoType getClassTypeId(
void);
00044
virtual SoType getTypeId(
void)
const;
00045 SbBool isOfType(
const SoType type)
const;
00046
00047
static void post(
const char *
const format, ...);
00048
00049
static SbString getString(
const SoNode *
const node);
00050
static SbString getString(
const SoPath *
const path);
00051
static SbString getString(
const SoEngine *
const engine);
00052
00053
static void initClass(
void);
00054
static void initClasses(
void);
00055
00056 virtual ~SoError() { }
00057
00058
protected:
00059
static void defaultHandlerCB(
const SoError * error,
void * userdata);
00060
virtual SoErrorCB * getHandler(
void * & data)
const;
00061
void setDebugString(
const char *
const str);
00062
void appendToDebugString(
const char *
const str);
00063
00064
void handleError(
void);
00065
00066
private:
00067
static void generateBaseString(
SbString & str,
const SoBase *
const base,
00068
const char *
const what);
00069
00070
static SoType classTypeId;
00071
static SoErrorCB * callback;
00072
static void * callbackData;
00073
SbString debugstring;
00074 };
00075
00076
#endif // !COIN_SOERROR_H