00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_EXCEPTIONS_EXCEPTION_H
00012
#define OPENCAL_EXCEPTIONS_EXCEPTION_H
00013
00014
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
00029 string m_type, m_message, m_file;
00030
int m_line;
00031
00032
public:
00033
00034 Exception(
const string &file,
int line);
00035 Exception(
const string &message =
"",
const string &file =
"",
int line = 0);
00036
virtual ~Exception();
00037
00038
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
00045
virtual string toString() const;
00046 virtual
void print() const;
00047
00048
00049 friend ostream &operator<<(ostream &stream, const Exception &e);
00050 };
00051 }
00052 }
00053
00054 #endif