main page
modules
namespaces
classes
files
Gecode home
Generated on Fri Aug 24 2012 04:52:17 for Gecode by
doxygen
1.8.1.1
gecode
support
exception.hpp
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Christian Schulte <schulte@gecode.org>
5
*
6
* Copyright:
7
* Christian Schulte, 2004
8
*
9
* Last modified:
10
* $Date: 2011-03-15 02:07:31 +1100 (Tue, 15 Mar 2011) $ by $Author: tack $
11
* $Revision: 11796 $
12
*
13
* This file is part of Gecode, the generic constraint
14
* development environment:
15
* http://www.gecode.org
16
*
17
* Permission is hereby granted, free of charge, to any person obtaining
18
* a copy of this software and associated documentation files (the
19
* "Software"), to deal in the Software without restriction, including
20
* without limitation the rights to use, copy, modify, merge, publish,
21
* distribute, sublicense, and/or sell copies of the Software, and to
22
* permit persons to whom the Software is furnished to do so, subject to
23
* the following conditions:
24
*
25
* The above copyright notice and this permission notice shall be
26
* included in all copies or substantial portions of the Software.
27
*
28
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
*
36
*/
37
38
#include <exception>
39
40
namespace
Gecode {
41
46
class
GECODE_SUPPORT_EXPORT
Exception
:
public
std::exception {
47
private
:
48
static
const
int
li_max = 127;
49
char
li
[li_max+1];
50
public
:
52
Exception
(
const
char
* l,
const
char
*
i
)
throw
();
54
virtual
const
char
* what(
void
)
const
throw
();
55
};
56
57
64
65
class
GECODE_VTABLE_EXPORT
MemoryExhausted
:
public
Exception
{
66
public
:
68
MemoryExhausted
(
void
);
69
};
71
class
GECODE_VTABLE_EXPORT
DynamicCastFailed
:
public
Exception
{
72
public
:
74
DynamicCastFailed
(
const
char
* l);
75
};
77
class
GECODE_VTABLE_EXPORT
OperatingSystemError
:
public
Exception
{
78
public
:
80
OperatingSystemError
(
const
char
* l);
81
};
83
84
/*
85
* Classes for exceptions
86
*
87
*/
88
inline
89
MemoryExhausted::MemoryExhausted
(
void
)
90
:
Exception
(
"Memory"
,
"Heap memory exhausted"
) {}
91
92
inline
93
DynamicCastFailed::DynamicCastFailed
(
const
char
* l)
94
:
Exception
(l,
"Attempt to perform dynamic_cast failed"
) {}
95
96
inline
97
OperatingSystemError::OperatingSystemError
(
const
char
* l)
98
:
Exception
(l,
"Operating system error"
) {}
99
100
}
101
102
// STATISTICS: support-any