Add no-deprecated to warnings due to dynamic exceptions.
[anna.git] / include / anna / dbms / Bind.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_dbms_Bind_hpp
10 #define anna_dbms_Bind_hpp
11
12 #include <anna/core/functions.hpp>
13 #include <anna/core/RuntimeException.hpp>
14
15 #include <anna/dbms/DatabaseException.hpp>
16 #include <anna/dbms/Data.hpp>
17
18 namespace anna {
19
20 namespace dbms {
21
22 class Connection;
23 class Statement;
24 class Data;
25
26 class Bind {
27 public:
28   dbms::Data& getData() throw() { return a_data; }
29   const dbms::Data& getData() const throw() { return a_data; }
30
31   virtual void prepare(Statement* statement, Connection* connection, const int pos)
32   throw(RuntimeException, DatabaseException) = 0;
33
34   virtual void release(Statement* statement) throw() = 0;
35   virtual void code() const throw(RuntimeException) = 0;
36   virtual void decode() const throw(RuntimeException) = 0;
37   virtual std::string asString() const throw();
38
39 protected:
40   Bind(const char* name, dbms::Data& data) : a_name(name), a_data(data) {;}
41
42 private:
43   const std::string a_name;
44   dbms::Data& a_data;
45
46   friend class Statement;
47 };
48
49 }
50 }
51
52 #endif
53