SoDebugError.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoDebugError.h
1 #ifndef COIN_SODEBUGERROR_H
2 #define COIN_SODEBUGERROR_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/errors/SoError.h>
28 #include <Inventor/C/errors/debugerror.h>
29
30 // Avoid problem with Microsoft Win32 API headers (yes, they actually
31 // #define ERROR -- in wingdi.h).
32 #if defined(ERROR)
33 #define SODEBUGERROR_STORE_ERROR_DEF ERROR
34 #undef ERROR
35 #endif /* ERROR */
36
37
38 class COIN_DLL_API SoDebugError : public SoError {
39 typedef SoError inherited;
40
41 public:
42 enum Severity { ERROR, WARNING, INFO };
43
44 static void setHandlerCallback(SoErrorCB * const function,
45 void * const data);
46 static SoErrorCB * getHandlerCallback(void);
47 static void * getHandlerData(void);
48
49 static SoType getClassTypeId(void);
50 virtual SoType getTypeId(void) const;
51
52 SoDebugError::Severity getSeverity(void) const;
53
54 static void post(const char * const source, const char * const format, ...);
55 static void postWarning(const char * const source, const char * const format, ...);
56 static void postInfo(const char * const source, const char * const format, ...);
57
58 static void initClass(void);
59
60 protected:
61 virtual SoErrorCBPtr getHandler(void * & data) const;
62
63 private:
64 static void callbackForwarder(const struct cc_debugerror * error, void * data);
65 static void commonPostHandling(Severity severity, const char * type,
66 const char * source, const SbString & s);
67
68 static SoType classTypeId;
69 static SoErrorCB * callback;
70 static void * callbackData;
71 Severity severity;
72 };
73
74 // Avoid problem with Microsoft Win32 API headers (see above).
75 #if defined(SODEBUGERROR_STORE_ERROR_DEF)
76 #define ERROR SODEBUGERROR_STORE_ERROR_DEF
77 #undef SODEBUGERROR_STORE_ERROR_DEF
78 #endif /* SODEBUGERROR_STORE_ERROR_DEF */
79
80 #endif // !COIN_SODEBUGERROR_H
SoError::setHandlerCallback
static void setHandlerCallback(SoErrorCB *const func, void *const data)
Definition: SoError.cpp:166
SoError::getHandlerData
static void * getHandlerData(void)
Definition: SoError.cpp:198
SoError::getTypeId
virtual SoType getTypeId(void) const
Definition: SoError.cpp:139
SoError::getHandler
virtual SoErrorCBPtr getHandler(void *&data) const
Definition: SoError.cpp:282
SoError::post
static void post(const char *const format,...)
Definition: SoError.cpp:221
SoError::getClassTypeId
static SoType getClassTypeId(void)
Definition: SoError.cpp:126
SoDebugError::Severity
Severity
Definition: SoDebugError.h:42
SoDebugError
The SoDebugError class is the internal debugging message passing mechanism.This class basically serve...
Definition: SoDebugError.h:38
SoError::getHandlerCallback
static SoErrorCB * getHandlerCallback(void)
Definition: SoError.cpp:188
SoError
The SoError class is the base class for all the error handling classes.The default error handler just...
Definition: SoError.h:41
SoError::initClass
static void initClass(void)
Definition: SoError.cpp:100
SbString
The SbString class is a string class with convenience functions for string operations.This is the class used for storing and working with character strings. It automatically takes care of supporting all the "bookkeeping" tasks usually associated with working with character strings, like memory allocation and deallocation etc.
Definition: SbString.h:42
SoType
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.