Generated on Sat Feb 7 2015 02:01:16 for Gecode by doxygen 1.8.9.1
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-14 16:07:31 +0100 (Mon, 14 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 
66  public:
68  MemoryExhausted(void);
69  };
72  public:
74  DynamicCastFailed(const char* l);
75  };
78  public:
80  OperatingSystemError(const char* l);
81  };
83 
84  /*
85  * Classes for exceptions
86  *
87  */
88  inline
90  : Exception("Memory","Heap memory exhausted") {}
91 
92  inline
94  : Exception(l,"Attempt to perform dynamic_cast failed") {}
95 
96  inline
98  : Exception(l,"Operating system error") {}
99 
100 }
101 
102 // STATISTICS: support-any
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
DynamicCastFailed(const char *l)
Initialize with location l.
Definition: exception.hpp:93
Exception: Memory exhausted
Definition: exception.hpp:65
Gecode::IntArgs i(4, 1, 2, 3, 4)
Exception: operating system error
Definition: exception.hpp:77
Exception: dynamic cast failed
Definition: exception.hpp:71
#define GECODE_SUPPORT_EXPORT
Definition: support.hh:75
MemoryExhausted(void)
Initialize.
Definition: exception.hpp:89
const LinInstr * li[]
Definition: mm-lin.cpp:1798
Exception: Base-class for exceptions
Definition: exception.hpp:46
Gecode toplevel namespace
OperatingSystemError(const char *l)
Initialize with location l.
Definition: exception.hpp:97
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76