-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExceptions.H
50 lines (42 loc) · 1.28 KB
/
Exceptions.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***********************************************************************
Exceptions.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
***********************************************************************/
#ifndef INCL_BOOM_Exceptions_H
#define INCL_BOOM_Exceptions_H
namespace BOOM {
#define INTERNAL_ERROR {cout<<"INTERNAL ERROR in "<<__FILE__<<" at line "<<__LINE__<<endl;throw "exiting";}
#define TRACE {cout<<"trace "<<__FILE__<<" "<<__LINE__<<endl;}
#define CHECKPOINT {cout<<__FILE__<<" "<<__LINE__;}
}
#include "String.H"
using namespace std;
namespace BOOM {
#define Endl endl
class RootException
{
public:
RootException(const char *);
RootException(const BOOM::String &);
const BOOM::String &getMessage() const;
void setMessage(const String &m);
protected:
String message;
};
class FileErrorException : public RootException
{
public:
FileErrorException(BOOM::String filename,BOOM::String msg);
};
class ArrayIndexException : public RootException
{
public:
ArrayIndexException(long index,const BOOM::String &msg);
private:
void installMessage(long index,const BOOM::String &);
};
}
#endif