]>
Dogcows Code - chaz/yoink/blob - src/Moof/stlplus/exceptions.hpp
1 #ifndef STLPLUS_EXCEPTIONS
2 #define STLPLUS_EXCEPTIONS
3 ////////////////////////////////////////////////////////////////////////////////
5 // Author: Andy Rushton
6 // Copyright: (c) Southampton University 1999-2004
7 // (c) Andy Rushton 2004-2009
8 // License: BSD License, see ../docs/license.html
10 // The set of general exceptions thrown by STLplus components
12 ////////////////////////////////////////////////////////////////////////////////
13 #include "containers_fixes.hpp"
20 ////////////////////////////////////////////////////////////////////////////////
21 // Thrown if a pointer or an iterator is dereferenced when it is null
23 class null_dereference
: public std::logic_error
26 null_dereference(const std::string
& description
) throw() :
27 std::logic_error(std::string("stlplus::null_dereference: ") + description
) {}
28 ~null_dereference(void) throw() {}
31 ////////////////////////////////////////////////////////////////////////////////
32 // Thrown if an iterator is dereferenced when it is pointing to the end element
34 class end_dereference
: public std::logic_error
37 end_dereference(const std::string
& description
) throw() :
38 std::logic_error("stlplus::end_dereference: " + description
) {}
39 ~end_dereference(void) throw() {}
42 ////////////////////////////////////////////////////////////////////////////////
43 // Thrown if an iterator is used with the wrong container. In other words, an
44 // iterator is created as a pointer to a sub-object within a container. If
45 // that iterator is then used with a different container, this exception is
48 class wrong_object
: public std::logic_error
51 wrong_object(const std::string
& description
) throw() :
52 std::logic_error("stlplus::wrong_object: " + description
) {}
53 ~wrong_object(void) throw() {}
56 ////////////////////////////////////////////////////////////////////////////////
57 // Thrown if an attempt is made to copy an object that is uncopyable
59 class illegal_copy
: public std::logic_error
62 illegal_copy(const std::string
& description
) throw() :
63 std::logic_error("stlplus::illegal_copy: " + description
) {}
64 ~illegal_copy(void) throw() {}
67 ////////////////////////////////////////////////////////////////////////////////
69 } // end namespace stlplus
This page took 0.035504 seconds and 4 git commands to generate.