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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
/* -*- mode: c++ -*-
*/
/*
GIFT, a flexible content based image retrieval system.
Copyright (C) 1998, 1999, 2000, 2001, 2002, CUI University of Geneva
Copyright (C) 2003, 2004 Bayreuth University
2005 Bamberg University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GIFTEXCEPTIONS
#define _GIFTEXCEPTIONS
using namespace std;
#include <iostream>
#include <fstream>
/** A base class for exceptions thrown by GIFT
WM 211099 created docs
WM 0899 created
@author Wolfgang Mueller
*/
class GIFTException{
/** This virtual function has to exsist,
in order to enable Runtime Type
identification. See Stroustrup about RTTI
for this. Exceptions rely on RTTI if I am not
mistaken.
*/
virtual void dummy();
protected:
/** The exception message*/
const char* mMessage;
/** will the message be killed? */
bool mDestroy;
public:
/** get the message contained in this */
const char* getMessage()const;
/** Constructor */
GIFTException(const char* inMessage);
/** Constructor */
GIFTException(char* inMessage);
/** Destructor */
virtual ~GIFTException();
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const GIFTException&);
};
/** Output operator sending a proper message */
ostream& operator<<(ostream& outStream,
const GIFTException&);
/** A file or a hash element was not found*/
class VENotFound:public GIFTException{
public:
/** Constructor */
VENotFound(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VENotFound& inException);
};
ostream& operator<<(ostream& outStream,
const VENotFound& inException);
/** a clear programming mistake in this code has been found*/
class VEProgrammingMistake:public GIFTException{
public:
/** Constructor */
VEProgrammingMistake(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VEProgrammingMistake& inException);
};
ostream& operator<<(ostream& outStream,
const VENotFound& inException);
/** An element which is considered bein only once
in a set was inserted another time. Example:
trying to create a session with an ID which
exsists already*/
class VEDoubleInsert:public GIFTException{
public:
/** Constructor */
VEDoubleInsert(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VEDoubleInsert& inException);
};
ostream& operator<<(ostream& outStream,
const VEDoubleInsert& inException);
/** i dunno (embarrassing), but it is quite late*/
class VEBaseUnknown:public GIFTException{
public:
/** */
VEBaseUnknown(const char* inMessage);
friend ostream& operator<<(ostream& outStream,
const VEBaseUnknown& inException);
};
ostream& operator<<(ostream& outStream,
const VEBaseUnknown& inException);
/** The accessor does not fit the chosen algorithm */
class VEWrongAccessor:public GIFTException{
public:
/** Constructor */
VEWrongAccessor(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VEWrongAccessor& inException);
};
ostream& operator<<(ostream& outStream,
const VEWrongAccessor& inException);
/** The the algorithm cannot be used with the collection chosen */
class VEWrongAlgorithm:public GIFTException{
public:
/** Constructor */
VEWrongAlgorithm(const char* inMessage);
/** Output into a stream*/
friend ostream& operator<<(ostream& outStream,
const VEWrongAlgorithm& inException);
};
ostream& operator<<(ostream& outStream,
const VEWrongAlgorithm& inException);
/** The the algorithm cannot be used with the collection chosen */
class VEWrongBaseType:public GIFTException{
public:
/** Constructor */
VEWrongBaseType(const char* inMessage);
/** Output into a stream*/
friend ostream& operator<<(ostream& outStream,
const VEWrongBaseType& inException);
};
ostream& operator<<(ostream& outStream,
const VEWrongBaseType& inException);
/** The session ID is unknown*/
class VEUnknownSession:public GIFTException{
public:
/** Constructor*/
VEUnknownSession(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VEUnknownSession& inException);
};
/** error in configuration, e.g. URL2FTS file */
class VEConfigurationError:public GIFTException{
public:
/** Constructor*/
VEConfigurationError(const char* inMessage);
/** Output into a stream */
friend ostream& operator<<(ostream& outStream,
const VEConfigurationError& inException);
};
ostream& operator<<(ostream& outStream,
const VEConfigurationError& inException);
#endif
|