epoc32/include/stdapis/boost/graph/exception.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/graph/exception.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/graph/exception.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,58 +1,44 @@
     1.4 +//=======================================================================
     1.5 +// Copyright 2002 Indiana University.
     1.6 +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
     1.7  //
     1.8 -// Boost.Pointer Container
     1.9 -//
    1.10 -//  Copyright Thorsten Ottosen 2003-2005. Use, modification and
    1.11 -//  distribution is subject to the Boost Software License, Version
    1.12 -//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.13 -//  http://www.boost.org/LICENSE_1_0.txt)
    1.14 -//
    1.15 -// For more information, see http://www.boost.org/libs/ptr_container/
    1.16 -//
    1.17 +// Distributed under the Boost Software License, Version 1.0. (See
    1.18 +// accompanying file LICENSE_1_0.txt or copy at
    1.19 +// http://www.boost.org/LICENSE_1_0.txt)
    1.20 +//=======================================================================
    1.21  
    1.22 -#ifndef BOOST_PTR_CONTAINER_EXCEPTION_HPP
    1.23 -#define BOOST_PTR_CONTAINER_EXCEPTION_HPP
    1.24 +#ifndef BOOST_GRAPH_EXCEPTION_HPP
    1.25 +#define BOOST_GRAPH_EXCEPTION_HPP
    1.26  
    1.27 -#if defined(_MSC_VER) && (_MSC_VER >= 1200)
    1.28 -# pragma once
    1.29 -#endif
    1.30 +#include <stdexcept>
    1.31 +#include <string>
    1.32  
    1.33 -#include <exception>
    1.34 +namespace boost {
    1.35  
    1.36 -namespace boost
    1.37 -{
    1.38 -    class bad_ptr_container_operation : public std::exception
    1.39 -    {
    1.40 -        const char* what_;
    1.41 -    public:
    1.42 -        bad_ptr_container_operation( const char* what ) : what_( what )
    1.43 -        { }
    1.44 -        
    1.45 -        virtual const char* what() const throw()
    1.46 -        {
    1.47 -            return what_;
    1.48 -        }
    1.49 -    };
    1.50 +  struct bad_graph : public std::invalid_argument {
    1.51 +    bad_graph(const std::string& what_arg)
    1.52 +      : std::invalid_argument(what_arg) { }
    1.53 +  };
    1.54  
    1.55 +  struct not_a_dag : public bad_graph {
    1.56 +    not_a_dag()
    1.57 +        : bad_graph("The graph must be a DAG.") { } 
    1.58 +  };
    1.59  
    1.60 -    
    1.61 -    class bad_index : public bad_ptr_container_operation
    1.62 -    {
    1.63 -    public:
    1.64 -        bad_index( const char* what ) : bad_ptr_container_operation( what )
    1.65 -        { }
    1.66 -    };
    1.67 +  struct negative_edge : public bad_graph {
    1.68 +    negative_edge()
    1.69 +      : bad_graph("The graph may not contain an edge with negative weight."){ }
    1.70 +  };
    1.71  
    1.72 +  struct negative_cycle : public bad_graph {
    1.73 +    negative_cycle()
    1.74 +      : bad_graph("The graph may not contain negative cycles.") { }
    1.75 +  };
    1.76 +  struct not_connected : public bad_graph {
    1.77 +    not_connected()
    1.78 +      : bad_graph("The graph must be connected.") { }
    1.79 +  };
    1.80  
    1.81 +} // namespace boost
    1.82  
    1.83 -    class bad_pointer : public bad_ptr_container_operation
    1.84 -    {
    1.85 -    public:
    1.86 -        bad_pointer() : bad_ptr_container_operation( "Null pointer not allowed in a pointer container!" )
    1.87 -        { }
    1.88 -        
    1.89 -        bad_pointer( const char* text ) : bad_ptr_container_operation( text )
    1.90 -        { }
    1.91 -    };
    1.92 -}
    1.93 -
    1.94 -#endif
    1.95 +#endif // BOOST_GRAPH_EXCEPTION_HPP