NAME

OTC_Exception - Base class for exceptions.

SYNOPSIS


#include <OTC/debug/excption.hh>

class OTC_Exception
{
  public:
    virtual ~OTC_Exception();
    OTC_Exception(char const* theError=0);
    OTC_Exception(
      char const* theError,
      char const* theFile,
      u_int theLine
    );
    OTC_Exception(OTC_Exception const& theException);
    inline char const* error() const;
    inline char const* file() const;
    inline u_int line() const;
    virtual void display(ostream& outs) const;
    static void throwException(OTC_Exception& theException);
    static OTC_ThrowFunction setThrow(OTC_ThrowFunction theFunction);
};

CLASS TYPE

Concrete

DESCRIPTION

This class is intended to be the ultimate base class for all exceptions. The class saves away information about the error which has occurred. This information can be queried directly or a message composing all the information can be dumped to an ostream. The class does not make copies of the character strings it is given, nor does it delete them. Thus, character strings passed to the constructor of the class should be literal strings, or otherwise be guaranteed not to be deleted.

EXAMPLE

INITIALISATION

OTC_Exception(char const* theError=0);
OTC_Exception(
  char const* theError,
  char const* theFile,
  u_int theLine
);
OTC_Exception(OTC_Exception const& theException);

QUERY

inline char const* error() const;
inline char const* file() const;
inline u_int line() const;

DISPLAY

virtual void display(ostream& outs) const;

THROWING AN EXCEPTION

static void throwException(OTC_Exception& theException);
static OTC_ThrowFunction setThrow(OTC_ThrowFunction theFunction);

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED