ANNA Suite  2020b
Multipurpose development suite for Telco applications
OutputBind.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_mysql_OutputBind_hpp
10 #define anna_dbms_mysql_OutputBind_hpp
11 
12 #include <anna/core/DataBlock.hpp>
13 
14 #include <anna/dbms/OutputBind.hpp>
16 
18 
19 namespace anna {
20 
21 class DataBlock;
22 
23 namespace dbms {
24 
25 class Statement;
26 
27 namespace mysql {
28 
29 class OutputBind : public dbms::OutputBind, public BaseBind {
30 public:
31  OutputBind(const char* name, dbms::Data& data);
32  ~OutputBind();
33 
34 private:
35  struct Blob {
36  DataBlock buffer;
37  st_mysql_stmt* stmt;
38  st_mysql_bind* binds;
39  int pos;
40 
41  Blob();
42  };
43 
44  Blob* a_blob;
45 
46  void decodeLongBlob(dbms::Data&) const noexcept(false);
47  void decodeDate(dbms::Data&) ;
48 
49  static unsigned char asByte(const char hex)
50  {
51  return (hex >= '0' && hex <= '9') ? (hex - '0') : ((hex - 'A') + 0x0a);
52  }
53 
54  /* Funciones virtuales puras */
55  void decode() const noexcept(false);
56  void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) noexcept(false);
57  void release(anna::dbms::Statement*) {;}
58  void do_write(const dbms::LongBlock&) const noexcept(false);
59 
60  friend class Statement;
61 };
62 
63 }
64 }
65 }
66 
67 #endif
68 
Definition: Connection.hpp:38
Definition: Statement.hpp:36
Definition: LongBlock.hpp:33
Definition: Statement.hpp:43
Definition: OutputBind.hpp:29
Definition: Data.hpp:27
Definition: OutputBind.hpp:26
Definition: app.hpp:12
Definition: DataBlock.hpp:24
Definition: BaseBind.hpp:22
OutputBind(const char *name, dbms::Data &data)