Oracle ODB Runtime Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
exceptions.hxx
Go to the documentation of this file.
1 // file : odb/oracle/exceptions.hxx
2 // copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC
3 // license : ODB NCUEL; see accompanying LICENSE file
4 
5 #ifndef ODB_ORACLE_EXCEPTIONS_HXX
6 #define ODB_ORACLE_EXCEPTIONS_HXX
7 
8 #include <odb/pre.hxx>
9 
10 #include <string>
11 #include <vector>
12 
13 #include <odb/exceptions.hxx>
14 
15 #include <odb/oracle/version.hxx>
16 #include <odb/oracle/forward.hxx>
18 #include <odb/oracle/details/export.hxx>
19 
20 namespace odb
21 {
22  namespace oracle
23  {
24  struct LIBODB_ORACLE_EXPORT database_exception: odb::database_exception
25  {
26  struct record
27  {
28  record (sb4 error, const std::string& message);
29 
30  sb4
31  error () const
32  {
33  return error_;
34  }
35 
36  const std::string&
37  message () const
38  {
39  return message_;
40  }
41 
42  private:
43  sb4 error_;
44  std::string message_;
45  };
46 
47  typedef std::vector<record> records;
48 
49  typedef records::size_type size_type;
50  typedef records::const_iterator iterator;
51 
52  iterator
53  begin () const
54  {
55  return records_.begin ();
56  }
57 
58  iterator
59  end () const
60  {
61  return records_.end ();
62  }
63 
64  size_type
65  size () const
66  {
67  return records_.size ();
68  }
69 
70  public:
71  ~database_exception () throw ();
72 
74  database_exception (sb4 error, const std::string& message);
75 
76  virtual const char*
77  what () const throw ();
78 
79  void
80  append (sb4 error, const std::string& message);
81 
82  private:
83  records records_;
84  std::string what_;
85  };
86 
87  struct LIBODB_ORACLE_EXPORT lob_comparison: odb::exception
88  {
89  virtual const char*
90  what () const throw ();
91  };
92 
93  struct LIBODB_ORACLE_EXPORT cli_exception: odb::exception
94  {
95  cli_exception (const std::string& what);
96  ~cli_exception () throw ();
97 
98  virtual const char*
99  what () const throw ();
100 
101  private:
102  std::string what_;
103  };
104 
105  struct LIBODB_ORACLE_EXPORT invalid_oci_handle: odb::exception
106  {
107  virtual const char*
108  what () const throw ();
109  };
110 
111  namespace core
112  {
115  using oracle::cli_exception;
117  }
118  }
119 }
120 
121 #include <odb/post.hxx>
122 
123 #endif // ODB_ORACLE_EXCEPTIONS_HXX
sb4 error() const
Definition: exceptions.hxx:31
Definition: exceptions.hxx:26
records::const_iterator iterator
Definition: exceptions.hxx:50
iterator end() const
Definition: exceptions.hxx:59
Definition: exceptions.hxx:93
Definition: exceptions.hxx:105
size_type size() const
Definition: exceptions.hxx:65
const std::string & message() const
Definition: exceptions.hxx:37
iterator begin() const
Definition: exceptions.hxx:53
std::vector< record > records
Definition: exceptions.hxx:47
Definition: exceptions.hxx:24
records::size_type size_type
Definition: exceptions.hxx:49
Definition: exceptions.hxx:87
signed int sb4
Definition: oracle-fwd.hxx:19