BALL
1.4.79
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
COMMON
COMMON/exception.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_COMMON_EXCEPTION_H
6
#define BALL_COMMON_EXCEPTION_H
7
8
#ifndef BALL_CONFIG_CONFIG_H
9
# include <BALL/CONFIG/config.h>
10
#endif
11
12
#ifndef BALL_COMMON_GLOBAL_H
13
# include <
BALL/COMMON/global.h
>
14
#endif
15
16
#ifdef BALL_COMPILER_MSVC
17
#pragma warning(push)
18
#pragma warning( disable : 4251 ) //disable needs to have dll-interface to be used by clients of class 'std::string'
19
#endif
20
21
#include <new>
22
#include <string>
23
24
namespace
BALL
25
{
26
27
class
String;
28
32
namespace
Exception
33
{
34
59
class
BALL_EXPORT
GeneralException
60
:
public
std::exception
61
{
62
public
:
63
67
69
GeneralException
();
70
72
GeneralException
(
const
char
* file,
int
line);
73
75
GeneralException
76
(
const
char
* file,
int
line,
77
const
String
& name ,
const
String
& message);
78
80
GeneralException
(
const
GeneralException
& exception);
81
83
virtual
~
GeneralException
()
throw
();
85
89
91
const
char
*
getName
()
const
;
92
94
const
char
* getMessage()
const
;
95
97
void
setMessage(
const
std::string& message);
98
100
int
getLine()
const
;
101
103
const
char
* getFile()
const
;
105
106
protected
:
107
const
char
*
file_
;
108
int
line_
;
109
110
std::string
name_
;
111
std::string
message_
;
112
};
113
122
class
BALL_EXPORT
IndexUnderflow
123
:
public
GeneralException
124
{
125
public
:
126
127
IndexUnderflow
(
const
char
* file,
int
line,
Index
index = 0,
Size
size = 0);
128
129
130
protected
:
131
132
Size
size_
;
133
Index
index_
;
134
};
135
143
class
BALL_EXPORT
SizeUnderflow
144
:
public
GeneralException
145
{
146
public
:
147
148
SizeUnderflow
(
const
char
* file,
int
line,
Size
size = 0);
149
150
protected
:
151
Size
size_
;
152
};
153
162
class
BALL_EXPORT
IndexOverflow
163
:
public
GeneralException
164
{
165
public
:
166
IndexOverflow
(
const
char
* file,
int
line,
Index
index = 0,
Size
size = 0);
167
168
protected
:
169
170
Size
size_
;
171
Index
index_
;
172
};
173
177
class
BALL_EXPORT
InvalidArgument
178
:
public
GeneralException
179
{
180
public
:
181
InvalidArgument
(
const
char
* file,
int
line,
const
String
& arg);
182
};
183
187
class
BALL_EXPORT
InvalidRange
188
:
public
GeneralException
189
{
190
public
:
191
InvalidRange
(
const
char
* file,
int
line,
float
value);
192
};
193
194
201
class
BALL_EXPORT
InvalidSize
202
:
public
GeneralException
203
{
204
public
:
205
206
InvalidSize
(
const
char
* file,
int
line,
Size
size = 0);
207
208
protected
:
209
Size
size_
;
210
};
211
212
217
class
BALL_EXPORT
OutOfRange
218
:
public
GeneralException
219
{
220
public
:
221
OutOfRange
(
const
char
* file,
int
line);
222
};
223
229
class
BALL_EXPORT
InvalidFormat
230
:
public
GeneralException
231
{
232
public
:
233
InvalidFormat
(
const
char
* file,
int
line,
const
String
& s);
234
235
~
InvalidFormat
()
throw
();
236
237
protected
:
238
239
std::string
format_
;
240
};
241
247
class
BALL_EXPORT
IllegalSelfOperation
248
:
public
GeneralException
249
{
250
public
:
251
IllegalSelfOperation
(
const
char
* file,
int
line);
252
};
253
258
class
BALL_EXPORT
NullPointer
259
:
public
GeneralException
260
{
261
public
:
262
NullPointer
(
const
char
* file,
int
line);
263
};
264
268
class
BALL_EXPORT
InvalidIterator
269
:
public
GeneralException
270
{
271
public
:
272
InvalidIterator
(
const
char
* file,
int
line);
273
};
274
279
class
BALL_EXPORT
IncompatibleIterators
280
:
public
GeneralException
281
{
282
public
:
283
IncompatibleIterators
(
const
char
* file,
int
line);
284
};
285
292
class
BALL_EXPORT
NotImplemented
293
:
public
GeneralException
294
{
295
public
:
296
NotImplemented
(
const
char
* file,
int
line);
297
};
298
303
class
BALL_EXPORT
IllegalTreeOperation
304
:
public
GeneralException
305
{
306
public
:
307
IllegalTreeOperation
(
const
char
* file,
int
line);
308
};
309
316
class
BALL_EXPORT
OutOfMemory
317
:
public
GeneralException
,
public
std::bad_alloc
318
{
319
public
:
320
OutOfMemory
(
const
char
* file,
int
line,
Size
size = 0);
321
322
virtual
~
OutOfMemory
()
323
throw
();
324
325
protected
:
326
Size
size_
;
327
};
328
331
class
BALL_EXPORT
BufferOverflow
332
:
public
GeneralException
333
{
334
public
:
335
BufferOverflow
(
const
char
* file,
int
line);
336
};
337
340
class
BALL_EXPORT
DivisionByZero
341
:
public
GeneralException
342
{
343
public
:
344
DivisionByZero
(
const
char
* file,
int
line);
345
};
346
349
class
BALL_EXPORT
OutOfGrid
350
:
public
GeneralException
351
{
352
public
:
353
OutOfGrid
(
const
char
* file,
int
line);
354
};
355
359
class
BALL_EXPORT
FileNotFound
360
:
public
GeneralException
361
{
362
public
:
363
FileNotFound
(
const
char
* file,
int
line,
const
String
& filename);
364
365
~
FileNotFound
()
366
throw
();
367
String
getFilename()
const
;
368
369
protected
:
370
std::string
filename_
;
371
};
372
376
class
BALL_EXPORT
IllegalPosition
377
:
public
GeneralException
378
{
379
public
:
380
IllegalPosition
(
const
char
* file,
int
line,
float
x,
float
y,
float
z);
381
};
382
386
class
BALL_EXPORT
ParseError
387
:
public
GeneralException
388
{
389
public
:
391
ParseError
(
const
char
* file,
int
line,
const
String
& expression,
392
const
String
& message);
393
};
394
398
class
BALL_EXPORT
Precondition
399
:
public
GeneralException
400
{
401
public
:
403
Precondition
(
const
char
* file,
int
line,
const
char
* condition);
404
};
405
409
class
BALL_EXPORT
Postcondition
410
:
public
GeneralException
411
{
412
public
:
414
Postcondition
(
const
char
* file,
int
line,
const
char
* condition);
415
};
416
418
class
BALL_EXPORT
InvalidOption
:
public
Exception::GeneralException
419
{
420
public
:
421
423
InvalidOption
(
const
char
* file,
int
line,
String
option);
424
};
425
427
class
BALL_EXPORT
TooManyErrors
428
:
public
Exception::GeneralException
429
{
430
public
:
432
TooManyErrors
(
const
char
* file,
int
line);
433
};
434
436
class
BALL_EXPORT
TooManyBonds
437
:
public
Exception::GeneralException
438
{
439
public
:
441
TooManyBonds
(
const
char
* file,
int
line,
const
String
& error);
442
};
443
447
class
BALL_EXPORT
CUDAError
448
:
public
Exception::GeneralException
449
{
450
public
:
451
CUDAError
(
const
char
* file,
int
line,
const
String
& error);
452
};
453
461
class
BALL_EXPORT
NoBufferAvailable
462
:
public
Exception::GeneralException
463
{
464
public
:
465
NoBufferAvailable
(
const
char
* file,
int
line,
const
String
& reason);
466
};
467
473
class
BALL_EXPORT
FormatUnsupported
474
:
public
Exception::GeneralException
475
{
476
public
:
477
FormatUnsupported
(
const
char
* file,
int
line);
478
};
479
485
class
BALL_EXPORT
NotInitialized
:
public
Exception::GeneralException
486
{
487
public
:
488
NotInitialized
(
const
char
* file,
int
line,
const
String
& reason);
489
};
490
493
class
BALL_EXPORT
GlobalExceptionHandler
494
{
495
public
:
499
516
GlobalExceptionHandler
();
518
522
524
static
void
setName(
const
String
& name);
525
527
static
void
setMessage(
const
String
& message);
528
530
static
void
setLine(
int
line);
531
533
static
void
setFile(
const
String
& file);
534
536
static
void
set
537
(
const
String
& file,
int
line,
538
const
String
& name,
const
String
& message);
540
541
protected
:
542
544
static
void
terminate();
545
547
static
void
newHandler()
throw
(
Exception::OutOfMemory
);
548
549
static
std::string
file_
;
550
static
int
line_
;
551
static
std::string
name_
;
552
static
std::string
message_
;
553
};
554
557
BALL_EXPORT
extern
GlobalExceptionHandler
globalHandler
;
558
559
}
578
BALL_EXPORT
579
std::ostream&
operator <<
(std::ostream& os,
const
Exception::GeneralException
& e);
580
581
}
// namespace BALL
582
583
#ifdef BALL_COMPILER_MSVC
584
#pragma warning(pop)
585
#endif
586
587
#endif // BALL_COMMON_EXCEPTION_H
BALL::Exception::GlobalExceptionHandler::line_
static int line_
Definition:
COMMON/exception.h:550
BALL::Exception::ParseError
Definition:
COMMON/exception.h:386
BALL::Exception::IllegalPosition
Definition:
COMMON/exception.h:376
BALL::Exception::GlobalExceptionHandler::message_
static std::string message_
Definition:
COMMON/exception.h:552
BALL::String
Definition:
string.h:61
BALL::Exception::IndexUnderflow::size_
Size size_
Definition:
COMMON/exception.h:132
BALL::Exception::Postcondition
Definition:
COMMON/exception.h:409
BALL::Exception::IndexOverflow::index_
Index index_
Definition:
COMMON/exception.h:171
BALL::Exception::IndexOverflow::size_
Size size_
Definition:
COMMON/exception.h:170
BALL::Exception::InvalidIterator
Definition:
COMMON/exception.h:268
BALL::Exception::FileNotFound
Definition:
COMMON/exception.h:359
BALL::Exception::OutOfMemory
Definition:
COMMON/exception.h:316
BALL::Exception::GlobalExceptionHandler
Definition:
COMMON/exception.h:493
BALL::Exception::OutOfGrid
Definition:
COMMON/exception.h:349
BALL::Exception::FormatUnsupported
Definition:
COMMON/exception.h:473
BALL::Exception::GeneralException::line_
int line_
Definition:
COMMON/exception.h:108
BALL::Exception::IndexUnderflow::index_
Index index_
Definition:
COMMON/exception.h:133
BALL::Exception::TooManyBonds
Exception to be thrown if too many bonds for one atom.
Definition:
COMMON/exception.h:436
BALL::Exception::InvalidRange
Definition:
COMMON/exception.h:187
BALL::Exception::GeneralException::name_
std::string name_
Definition:
COMMON/exception.h:110
BALL::Exception::InvalidSize
Definition:
COMMON/exception.h:201
BALL::Exception::CUDAError
Definition:
COMMON/exception.h:447
BALL::Exception::InvalidOption
Exception to be thrown if an invalid option is given.
Definition:
COMMON/exception.h:418
BALL::operator<<
BALL_EXPORT std::ostream & operator<<(std::ostream &os, const Exception::GeneralException &e)
BALL::Exception::SizeUnderflow
Definition:
COMMON/exception.h:143
BALL::Exception::NoBufferAvailable
Definition:
COMMON/exception.h:461
BALL::Exception::TooManyErrors
Exception to be thrown if too many errors occur, e.g. in ForceField.
Definition:
COMMON/exception.h:427
BALL::Exception::GeneralException::message_
std::string message_
Definition:
COMMON/exception.h:111
BALL::Exception::BufferOverflow
Definition:
COMMON/exception.h:331
BALL::Exception::IndexOverflow
Definition:
COMMON/exception.h:162
BALL::Exception::OutOfRange
Definition:
COMMON/exception.h:217
BALL::Exception::FileNotFound::filename_
std::string filename_
Definition:
COMMON/exception.h:370
BALL::Exception::NullPointer
Definition:
COMMON/exception.h:258
BALL::Exception::InvalidArgument
Definition:
COMMON/exception.h:177
BALL::Exception::GlobalExceptionHandler::file_
static std::string file_
Definition:
COMMON/exception.h:549
BALL::RTTI::getName
const char * getName()
Definition:
rtti.h:97
BALL::Exception::IllegalTreeOperation
Definition:
COMMON/exception.h:303
BALL::Exception::NotInitialized
Definition:
COMMON/exception.h:485
BALL::Exception::InvalidFormat
Definition:
COMMON/exception.h:229
BALL_SIZE_TYPE
BALL::Exception::GeneralException::file_
const char * file_
Definition:
COMMON/exception.h:107
BALL::Exception::IllegalSelfOperation
Definition:
COMMON/exception.h:247
BALL::Exception::NotImplemented
Definition:
COMMON/exception.h:292
BALL_INDEX_TYPE
global.h
BALL::Exception::IndexUnderflow
Definition:
COMMON/exception.h:122
BALL::Exception::GeneralException
Definition:
COMMON/exception.h:59
BALL::Exception::InvalidFormat::format_
std::string format_
Definition:
COMMON/exception.h:239
BALL::Exception::IncompatibleIterators
Definition:
COMMON/exception.h:279
BALL::Exception::OutOfMemory::size_
Size size_
Definition:
COMMON/exception.h:326
BALL::Exception::globalHandler
BALL_EXPORT GlobalExceptionHandler globalHandler
BALL::Exception::DivisionByZero
Definition:
COMMON/exception.h:340
BALL_EXPORT
#define BALL_EXPORT
Definition:
COMMON/global.h:50
BALL::Exception::InvalidSize::size_
Size size_
Definition:
COMMON/exception.h:209
BALL::Exception::GlobalExceptionHandler::name_
static std::string name_
Definition:
COMMON/exception.h:551
BALL::Exception::SizeUnderflow::size_
Size size_
Definition:
COMMON/exception.h:151
BALL::Exception::Precondition
Definition:
COMMON/exception.h:398
Generated by
1.8.7