os/ossrv/ossrv_pub/boost_apis/boost/graph/exception.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
//=======================================================================
sl@0
     2
// Copyright 2002 Indiana University.
sl@0
     3
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
sl@0
     4
//
sl@0
     5
// Distributed under the Boost Software License, Version 1.0. (See
sl@0
     6
// accompanying file LICENSE_1_0.txt or copy at
sl@0
     7
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
     8
//=======================================================================
sl@0
     9
sl@0
    10
#ifndef BOOST_GRAPH_EXCEPTION_HPP
sl@0
    11
#define BOOST_GRAPH_EXCEPTION_HPP
sl@0
    12
sl@0
    13
#include <stdexcept>
sl@0
    14
#include <string>
sl@0
    15
sl@0
    16
namespace boost {
sl@0
    17
sl@0
    18
  struct bad_graph : public std::invalid_argument {
sl@0
    19
    bad_graph(const std::string& what_arg)
sl@0
    20
      : std::invalid_argument(what_arg) { }
sl@0
    21
  };
sl@0
    22
sl@0
    23
  struct not_a_dag : public bad_graph {
sl@0
    24
    not_a_dag()
sl@0
    25
        : bad_graph("The graph must be a DAG.") { } 
sl@0
    26
  };
sl@0
    27
sl@0
    28
  struct negative_edge : public bad_graph {
sl@0
    29
    negative_edge()
sl@0
    30
      : bad_graph("The graph may not contain an edge with negative weight."){ }
sl@0
    31
  };
sl@0
    32
sl@0
    33
  struct negative_cycle : public bad_graph {
sl@0
    34
    negative_cycle()
sl@0
    35
      : bad_graph("The graph may not contain negative cycles.") { }
sl@0
    36
  };
sl@0
    37
  struct not_connected : public bad_graph {
sl@0
    38
    not_connected()
sl@0
    39
      : bad_graph("The graph must be connected.") { }
sl@0
    40
  };
sl@0
    41
sl@0
    42
} // namespace boost
sl@0
    43
sl@0
    44
#endif // BOOST_GRAPH_EXCEPTION_HPP