Qucs-core  0.0.19
exception.h
Go to the documentation of this file.
00001 /*
00002  * exception.h - exception class definitions
00003  *
00004  * Copyright (C) 2004 Stefan Jahn <stefan@lkcc.org>
00005  *
00006  * This is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This software is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this package; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  * $Id$
00022  *
00023  */
00024 
00025 #ifndef __EXCEPTION_H__
00026 #define __EXCEPTION_H__
00027 
00028 namespace qucs {
00029 
00030 /* Enumerate exception type identifiers. */
00031 enum exception_type {
00032   EXCEPTION_UNKNOWN = -1,
00033   EXCEPTION_PIVOT,
00034   EXCEPTION_NA_FAILED,
00035   EXCEPTION_NO_CONVERGENCE,
00036   EXCEPTION_ZERO_DIVISION,
00037   EXCEPTION_WRONG_VOLTAGE,
00038   EXCEPTION_SINGULAR,
00039   EXCEPTION_MATH,
00040   EXCEPTION_UNKNOWN_ETR_MODE,
00041 };
00042 
00043 class exception
00044 {
00045  public:
00046   exception ();
00047   exception (int);
00048   exception (const exception &);
00049   ~exception ();
00050   int getCode (void) { return code; }
00051   void setCode (int c) { code = c; }
00052   char * getText (void) { return txt; }
00053   void setText (const char *, ...);
00054   exception * getNext (void) { return next; }
00055   void setNext (exception * e) { next = e; }
00056   void setData (int d) { data = d; }
00057   int getData (void) { return data; }
00058 
00059  private:
00060   int code;
00061   int data;
00062   char * txt;
00063   exception * next;
00064 };
00065 
00066 } /* namespace qucs */
00067 
00068 #endif /* __EXCEPTION_H__ */