Coin Logo http://www.sim.no
http://www.coin3d.org

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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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
SoDebugError::getHandler
virtual SoErrorCBPtr getHandler(void *&data) const
Definition: SoDebugError.cpp:341
SoDebugError
The SoDebugError class is the internal debugging message passing mechanism.
Definition: SoDebugError.h:38
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoError::setHandlerCallback
static void setHandlerCallback(SoErrorCB *const func, void *const data)
Definition: SoError.cpp:164
SoError::defaultHandlerCB
static void defaultHandlerCB(const SoError *error, void *userdata)
Definition: SoError.cpp:268
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SbString
The SbString class is a string class with convenience functions for string operations.
Definition: SbString.h:42
SoType
The SoType class is the basis for the run-time type system in Coin.
Definition: SoType.h:50
SoError::getHandlerData
static void * getHandlerData(void)
Definition: SoError.cpp:194
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoError::getClassTypeId
static SoType getClassTypeId(void)
Definition: SoError.cpp:124
SoError::appendToDebugString
void appendToDebugString(const char *const str)
Definition: SoError.cpp:297
SoError::handleError
void handleError(void)
Definition: SoError.cpp:308
SoError::setDebugString
void setDebugString(const char *const str)
Definition: SoError.cpp:288
SoDebugError::Severity
Severity
Definition: SoDebugError.h:42
SoType::createType
static const SoType createType(const SoType parent, const SbName name, const instantiationMethod method=(instantiationMethod) NULL, const uint16_t data=0)
Definition: SoType.cpp:256
SoError::initClass
static void initClass(void)
Definition: SoError.cpp:98
SoError::getTypeId
virtual SoType getTypeId(void) const
Definition: SoError.cpp:137
SoError
The SoError class is the base class for all the error handling classes.
Definition: SoError.h:41
SoError::post
static void post(const char *const format,...)
Definition: SoError.cpp:217
SoError::getHandler
virtual SoErrorCBPtr getHandler(void *&data) const
Definition: SoError.cpp:278
SoDebugError::getSeverity
SoDebugError::Severity getSeverity(void) const
Definition: SoDebugError.cpp:248
SoError::getHandlerCallback
static SoErrorCB * getHandlerCallback(void)
Definition: SoError.cpp:184
SbString::getString
const char * getString(void) const
Definition: SbString.h:71
SoDebugError::getTypeId
virtual SoType getTypeId(void) const
Definition: SoDebugError.cpp:233

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17