/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/external/stlplus/include/stlplus/exceptions.hpp Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/external/stlplus/include/stlplus/exceptions.hpp Source File
Ratpac-two
exceptions.hpp
1 #ifndef EXCEPTIONS_HPP
2 #define EXCEPTIONS_HPP
3 /*------------------------------------------------------------------------------
4 
5  Author: Andy Rushton
6  Copyright: (c) Andy Rushton, 2004
7  License: BSD License, see ../docs/license.html
8 
9  The set of general exceptions thrown by STLplus components
10 
11  ------------------------------------------------------------------------------*/
12 #include <stdexcept>
13 
14 #include "os_fixes.hpp"
15 
17 // Thrown if a pointer or an iterator is dereferenced when it is null
18 
19 class null_dereference : public std::logic_error {
20  public:
21  null_dereference(const std::string& description) throw();
22  ~null_dereference(void) throw();
23 };
24 
26 // Thrown if an iterator is dereferenced when it is pointing to the end element
27 
28 class end_dereference : public std::logic_error {
29  public:
30  end_dereference(const std::string& description) throw();
31  ~end_dereference(void) throw();
32 };
33 
35 // Thrown if an iterator is used with the wrong container. In other words, an
36 // iterator is created as a pointer to a sub-object within a container. If
37 // that iterator is then used with a different container, this exception is
38 // thrown.
39 
40 class wrong_object : public std::logic_error {
41  public:
42  wrong_object(const std::string& description) throw();
43  ~wrong_object(void) throw();
44 };
45 
47 #endif
Definition: exceptions.hpp:28
Definition: exceptions.hpp:19
Definition: exceptions.hpp:40