Exception.h File Reference

Contains the GG::Exception base class and macros that ease declaring subclasses. More...

#include <stdexcept>
#include <string>

Go to the source code of this file.

Namespaces

namespace  GG

Classes

class  GG::ExceptionBase
 This is the base class for all GG exceptions. More...

Defines

#define GG_EXCEPTION(name)
#define GG_ABSTRACT_EXCEPTION(name)
#define GG_CONCRETE_EXCEPTION(name, class_name, superclass)


Detailed Description

Contains the GG::Exception base class and macros that ease declaring subclasses.

Definition in file Exception.h.


Define Documentation

#define GG_EXCEPTION ( name   ) 

Value:

class GG_API name : public ExceptionBase                            \
    {                                                                   \
    public:                                                             \
        name () throw() : ExceptionBase() {}                            \
        name (const std::string& msg) throw() : ExceptionBase(msg) {}   \
        virtual const char* type() const throw()                        \
            {return "GG::" # name ;}                                    \
    };
Declares a GG exception class.

This should be used to declare GG exceptions at global scope.

Definition at line 72 of file Exception.h.

#define GG_ABSTRACT_EXCEPTION ( name   ) 

Value:

class GG_API name : public ExceptionBase                            \
    {                                                                   \
    public:                                                             \
        name () throw() : ExceptionBase() {}                            \
        name (const std::string& msg) throw() : ExceptionBase(msg) {}   \
        virtual const char* type() const throw() = 0;                   \
    };
Declares an abstract base for further GG exception class inheritance.

This should be used along with GG_CONCRETE_EXCEPTION to group all exceptions from a single GG class under one subhierarchy.

Definition at line 85 of file Exception.h.

#define GG_CONCRETE_EXCEPTION ( name,
class_name,
superclass   ) 

Value:

class GG_API name : public superclass                               \
    {                                                                   \
    public:                                                             \
        name () throw() : superclass () {}                              \
        name (const std::string& msg) throw() : superclass (msg) {}     \
        virtual const char* type() const throw()                        \
            {return # class_name "::" # name ;}                         \
    };
Declares a concrete exception class derived from superclass.

This should be used along with GG_ABSTRACT_EXCEPTION to group all exceptions from a single GG class under one subhierarchy.

Definition at line 96 of file Exception.h.


Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2