]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | //======================================================================= |
2 | // Copyright 2002 Indiana University. | |
3 | // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek | |
4 | // | |
5 | // Distributed under the Boost Software License, Version 1.0. (See | |
6 | // accompanying file LICENSE_1_0.txt or copy at | |
7 | // http://www.boost.org/LICENSE_1_0.txt) | |
8 | //======================================================================= | |
9 | ||
10 | #ifndef BOOST_GRAPH_EXCEPTION_HPP | |
11 | #define BOOST_GRAPH_EXCEPTION_HPP | |
12 | ||
13 | #include <stdexcept> | |
14 | #include <string> | |
15 | ||
f67539c2 TL |
16 | namespace boost |
17 | { | |
18 | ||
19 | struct BOOST_SYMBOL_VISIBLE bad_graph : public std::invalid_argument | |
20 | { | |
21 | bad_graph(const std::string& what_arg) : std::invalid_argument(what_arg) {} | |
22 | }; | |
23 | ||
24 | struct BOOST_SYMBOL_VISIBLE not_a_dag : public bad_graph | |
25 | { | |
26 | not_a_dag() : bad_graph("The graph must be a DAG.") {} | |
27 | }; | |
28 | ||
29 | struct BOOST_SYMBOL_VISIBLE negative_edge : public bad_graph | |
30 | { | |
31 | negative_edge() | |
32 | : bad_graph("The graph may not contain an edge with negative weight.") | |
33 | { | |
34 | } | |
35 | }; | |
36 | ||
37 | struct BOOST_SYMBOL_VISIBLE negative_cycle : public bad_graph | |
38 | { | |
39 | negative_cycle() : bad_graph("The graph may not contain negative cycles.") | |
40 | { | |
41 | } | |
42 | }; | |
43 | ||
44 | struct BOOST_SYMBOL_VISIBLE not_connected : public bad_graph | |
45 | { | |
46 | not_connected() : bad_graph("The graph must be connected.") {} | |
47 | }; | |
48 | ||
49 | struct BOOST_SYMBOL_VISIBLE not_complete : public bad_graph | |
50 | { | |
51 | not_complete() : bad_graph("The graph must be complete.") {} | |
52 | }; | |
7c673cae FG |
53 | |
54 | } // namespace boost | |
55 | ||
56 | #endif // BOOST_GRAPH_EXCEPTION_HPP |