Exception.h File Reference

Base class for all H3D Exceptions. More...

#include <string>
#include <iostream>
#include <H3DUtil/H3DUtil.h>

Go to the source code of this file.


Classes

class  H3DUtil::Exception::H3DException
 The base class for all exceptions. More...
class  H3DUtil::Exception::H3DAPIException
 This is the base class for exceptions where the location in the source code is included. More...
class  H3DUtil::Exception::ValueException< ValueType >
 A virtual template class for instantiating exceptions based on a value. More...
class  H3DUtil::Exception::QuitAPI
 This is special exception that can be thrown in order to quit the API. More...

Namespaces

namespace  H3DUtil
 H3DUtil namespace.

Defines

#define H3D_FULL_LOCATION   __FUNCTION__, __FILE__, __LINE__
 Macro for use with H3DUtil::Exception::H3DAPIException constructor.
#define H3D_FILE_LOCATION   "", __FILE__, __LINE__
 Macro for use with H3DUtil::Exception::H3DAPIException constructor.
#define H3D_FUNCTION_LOCATION   __FUNCTION__
 Macro for use with H3DUtil::Exception::H3DAPIException constructor.
#define H3D_VALUE_EXCEPTION(value_type, name)
 Macro for easy creation of a H3DUtil::Exception::ValueException class.
#define H3D_API_EXCEPTION(name)
 Macro for easy creation of a H3DUtil::Exception::H3DAPIException subclass.

Functions

ostream & H3DUtil::Exception::operator<< (ostream &os, const H3DException &e)
 The << operator calls the print() function of the H3DException.


Detailed Description

Base class for all H3D Exceptions.


Define Documentation

#define H3D_API_EXCEPTION ( name   ) 

Value:

class name : public H3DUtil::Exception::H3DAPIException {                  \
  public:                                                                   \
    name( const string &_message = "",                                      \
          const string &_function = "",                                     \
          const string &_filename = "",                                     \
          const int &_linenumber = -1 ) :                                   \
      H3DUtil::Exception::H3DAPIException( _message, _function,              \
                _filename, _linenumber) {}                                  \
  protected:                                                                \
    string className() const { return #name; }                         \
}
Macro for easy creation of a H3DUtil::Exception::H3DAPIException subclass.

Parameters:
name the name of the class to define

#define H3D_FILE_LOCATION   "", __FILE__, __LINE__

Macro for use with H3DUtil::Exception::H3DAPIException constructor.

Are to be given to the constructor in place for the arguments function, filename and linenumber. The exception will then include info about file name and line number of the exception.

#define H3D_FULL_LOCATION   __FUNCTION__, __FILE__, __LINE__

#define H3D_FUNCTION_LOCATION   __FUNCTION__

Macro for use with H3DUtil::Exception::H3DAPIException constructor.

Are to be given to the constructor in place for the arguments function, filename and linenumber. The exception will then include info about the function in which the exception occured.

#define H3D_VALUE_EXCEPTION ( value_type,
name   ) 

Value:

class name : public H3DUtil::Exception::ValueException< value_type > {     \
  public:                                                                   \
    name( value_type _value,                                                \
          const string &_message = "",                                      \
          const string &_function = "",                                     \
          const string &_filename = "",                                     \
          const int &_linenumber = -1 ) :                                   \
      H3DUtil::Exception::ValueException< value_type >( _value, _message,    \
    _function,                                                              \
    _filename, _linenumber) {}                                              \
  protected:                                                                \
    string className() const { return #name; }                         \
}
Macro for easy creation of a H3DUtil::Exception::ValueException class.

Parameters:
value_type the type of the value
name the name of the class to define


Generated on Fri Nov 7 10:23:38 2008 for H3DUtil by  doxygen 1.5.7