ANNA Suite  2020b
Multipurpose development suite for Telco applications
Bind.hpp
Go to the documentation of this file.
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>
14 
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() { return a_data; }
29  const dbms::Data& getData() const { return a_data; }
30 
31  virtual void prepare(Statement* statement, Connection* connection, const int pos)
32  noexcept(false) = 0;
33 
34  virtual void release(Statement* statement) = 0;
35  virtual void code() const noexcept(false) = 0;
36  virtual void decode() const noexcept(false) = 0;
37  virtual std::string asString() const ;
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 
virtual void prepare(Statement *statement, Connection *connection, const int pos) noexcept(false)=0
Definition: Bind.hpp:26
Definition: Connection.hpp:38
Definition: Statement.hpp:43
dbms::Data & getData()
Definition: Bind.hpp:28
virtual void release(Statement *statement)=0
Bind(const char *name, dbms::Data &data)
Definition: Bind.hpp:40
Definition: Data.hpp:27
virtual void decode() const noexcept(false)=0
const dbms::Data & getData() const
Definition: Bind.hpp:29
Definition: app.hpp:12
virtual void code() const noexcept(false)=0
virtual std::string asString() const