Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Exception.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_EXCEPTIONS_EXCEPTION_H 00012 #define OPENCAL_EXCEPTIONS_EXCEPTION_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 00017 #include <ostream> 00018 using std::ostream; 00019 00020 00021 namespace OpenCAL 00022 { 00023 namespace Exceptions 00024 { 00025 class OPENCAL_API Exception 00026 { 00027 protected: 00028 // Member variables 00029 string m_type, m_message, m_file; 00030 int m_line; 00031 00032 public: 00033 // Constructors and destructor 00034 Exception(const string &file, int line); 00035 Exception(const string &message = "", const string &file = "", int line = 0); 00036 virtual ~Exception(); 00037 00038 // Get functions 00039 virtual const string &getType() const { return m_type; } 00040 virtual const string &getMessage() const { return m_message; } 00041 virtual const string &getFile() const { return m_file; } 00042 virtual int getLine() const { return m_line; } 00043 00044 // Other functions 00045 virtual string toString() const; 00046 virtual void print() const; 00047 00048 // Friend functions 00049 friend ostream &operator<<(ostream &stream, const Exception &e); 00050 }; 00051 } 00052 } 00053 00054 #endif // OPENCAL_EXCEPTIONS_EXCEPTION_H

Generated on Sun Aug 15 19:19:22 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8