CompleteDB Embedded: Direct C++ API  2.4.2
Table.hpp
Go to the documentation of this file.
1 #ifndef COMPLETEDB_TABLE_HPP
2 #define COMPLETEDB_TABLE_HPP
3 
4 #include "CompleteDb.h"
6 #include "completedb/Object.hpp"
10 
11 namespace completedb {
12 
18 class Table
19 : public virtual Object
20 , public LastError
21 , public TableDml
22 , public TableInfo
23 {
24 
25  friend class Database;
26 
27 public: // override Object iface
28 
32  inline bool cast(const Object& from) { return completedb_Table_cast(&m, from.get(), from.getClassType()); }
36  inline bool isConnected() const { return completedb_Table_isConnected(m); }
40  inline bool isDisconnected() const { return completedb_Table_isDisconnected(m); }
49 
50 public: // override LastError iface
51 
59  inline const char* getLastError() const { return completedb_Table_getLastError(m); }
60 
61 public: // override EntityInfo iface
62 
66  inline const char* getDescription() const { return completedb_Table_getDescription(m); }
67 
68 public: // override IdentityInfo iface
69 
73  inline const char* getName() const { return completedb_Table_getName(m); }
74 
75 public: // override TableDml iface
76 
81 
82 public: // override TableInfo iface
83 
87  inline bool containsColumn(const char* name) { return completedb_Table_containsColumn(m, name); }
91  inline bool containsColumn(const IdentityInfo& name) { return completedb_Table_containsColumn(m, name.getName()); }
95  inline bool exists() { return completedb_Table_exists(m); }
100 
101 public: // factory lvalue
102 
103  Table& operator=(const Table& src) { completedb_Table_assign(&m, src.m, src.getClassType()); return *this; }
105 
106 public: // factory
107 
108  virtual ~Table() { completedb_Table_free(&m); }
110 
111 private: // factory
112 
113  Table(void* src) : Object(src) {}
114 
115 };
116 
117 } // namespace
118 
119 #endif /* COMPLETEDB_TABLE_HPP */