Covalent Bond  0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
cbTable.cpp
Go to the documentation of this file.
1 
11 #include "cbTable.hpp"
12 #include <workflow/MySQLResult.h>
13 
14 // ------------------------- The code below is dropped.--------------
15 // --- Go to len=46 for latest code. -------------------------------
16 // ------------------------- The code below is dropped.--------------
17 
18 int cbCell::asInt() { return std::get<int>(data); }
19 
20 float cbCell::asFloat() { return std::get<float>(data); }
21 
22 bool cbCell::asBool() { return std::get<bool>(data); }
23 
24 std::string& cbCell::asString() { return std::get<std::string>(data); }
25 
26 void cbCell::setAsLuaInt(sol::object rhs) { data = rhs.as<int>(); }
27 
28 void cbCell::setAsLuaFloat(sol::object rhs) { data = rhs.as<float>(); }
29 
30 void cbCell::setAsLuaBool(sol::object rhs) { data = rhs.as<bool>(); }
31 
32 void cbCell::setAsLuaString(sol::object rhs) { data = rhs.as<std::string>(); }
33 
34 void cbCell::setAsCppInt(int32_t rhs) { data = rhs; }
35 
36 void cbCell::setAsCppFloat(float rhs) { data = rhs; }
37 
38 void cbCell::setAsCppBool(bool rhs) { data = rhs; }
39 
40 void cbCell::setAsCppString(std::string rhs) { data = rhs; }
41 
42 // -------------- below is for actually use. ---------------------------------
43 // -------------- below is for actually use. ---------------------------------
44 // -------------- below is for actually use. ---------------------------------
45 
46 // And I will provide a bunch of function for sol::lua to use.
47 
49  for (int32_t i = 0; i < m_fieldCount; ++i) { delete m_info[i]; }
50  delete[] m_info;
51 }
52 
53 cbVirtualSharedTable::cbVirtualSharedTable(protocol::MySQLResultCursor* cursor) {
54  if (cursor->get_cursor_status() == MYSQL_STATUS_GET_RESULT) {
55  // create filed buffer. move the memory from cursor to virtual table.
56  m_fieldCount = cursor->get_field_count();
58  const protocol::MySQLField* const* __tmpCursorFieldPtr =
59  cursor->fetch_fields();
60  for (int32_t i = 0; i < m_fieldCount; ++i) {
61  m_info[i] = new cbMySQLField(__tmpCursorFieldPtr[i]);
62  }
63  // no loop. just get the first result set !!!
64  // Note that the implementation of workflow's MySqlCell use void* to store
65  // different data types, so I adopt RAII programming style in this class.
66  std::vector<std::vector<protocol::MySQLCell>> __data;
67  cursor->fetch_all(__data);
68  m_shape[0] = cursor->get_rows_count();
69  m_shape[1] = static_cast<int32_t>(__data[0].size());
71  for (int32_t i = 0; i < m_shape[0]; ++i) {
72  for (int32_t j = 0; j < m_shape[1]; ++j) { m_data[i][j] = __data[i][j]; }
73  }
74  }
75 }
76 
77 cbMySQLCell* cbVirtualSharedTable::atPtr(int32_t i, int32_t j) { return &m_data[i][j]; }
78 
79 cbMySQLCell* cbVirtualSharedTable::atPtrRef(int32_t i, int32_t j) { return &m_data[i][j]; }
80 
82  m_shape = shape;
83  m_data.resize(m_shape[0]);
84  for (auto& item : m_data) {
85  item.resize(m_shape[1]);
86  item.shrink_to_fit();
87  }
88  m_data.shrink_to_fit();
89 }
90 
91 void cbVirtualSharedTable::resetFieldInfo(int32_t fieldCount, cbMySQLField** info) {
92  for (int32_t i = 0; i < m_fieldCount; ++i) { delete m_info[i]; }
93  delete[] m_info;
94  m_info = info;
95  m_fieldCount = fieldCount;
96 }
97 
99  // row major
100  m_shape = shape;
101  m_data.resize(m_shape[0]); // row.
102  for (auto& item : m_data) {
103  item.resize(m_shape[1]);
104  item.shrink_to_fit();
105  } // col.
106  m_data.shrink_to_fit();
107 }
108 
110  resetShape(shape);
111  m_isInfoExtent = true;
112  m_info = new cbMySQLField*[shape[1]];
113 }
114 
116 
118 
120  m_isInfoExtent = true;
121  m_info[i] = v;
122 }
123 
125 
126 std::vector<std::vector<cbMySQLCell*>>& cbVirtualTable::getData() { return m_data; }
127 
128 cbMySQLCell* cbVirtualTable::atPtr(int32_t i, int32_t j) { return m_data[i][j]; }
129 
130 cbMySQLCell*& cbVirtualTable::atPtrRef(int32_t i, int32_t j) { return m_data[i][j]; }
131 
132 void cbVirtualTable::setPtrAt(int32_t i, int32_t j, cbMySQLCell* v) { atPtrRef(i, j) = v; }
133 
135  if (i >= 0 && i < m_shape[0]) [[likely]] {
136  int32_t col = m_shape[1];
137  cbVirtualTable tmp(makeShapeFull(1, col));
138  for (int32_t c = 0; c < col; ++c) { tmp.atPtrRef(0, c) = this->atPtrRef(i, c); }
139  tmp.setInfo(this->m_info);
140  return tmp;
141  }
142  return cbVirtualTable(makeShapeFull(0, 0));
143 }
144 
146  if (i >= 0 && i < m_shape[1]) [[likely]] {
147  int32_t row = m_shape[0];
148  cbVirtualTable tmp(makeShapeFull(row, 1));
149  for (int32_t r = 0; r < row; ++r) { tmp.atPtrRef(r, 0) = this->atPtrRef(r, i); }
150  tmp.setInfo(this->getInfo() + i);
151  return tmp;
152  }
153  return cbVirtualTable(makeShapeFull(0, 0));
154 }
155 
156 std::map<int32_t, int32_t> cbVirtualTable::keyBy(const std::string& colName) const {
157  std::map<int32_t, int32_t> tmp;
158  int32_t row = m_shape[0];
159  int32_t col = m_shape[1];
160  int atCol = 0;
161  // hash funcs
162  std::hash<std::string> hash_string;
163  [[maybe_unused]] std::hash<float> hash_float;
164  [[maybe_unused]] std::hash<double> hash_double;
165  [[maybe_unused]] std::hash<int> hash_int;
166  [[maybe_unused]] std::hash<unsigned long long> hash_ull;
167 
168  // loops
169  for (atCol = 0; atCol < col; ++atCol) {
170  if (m_info[atCol]->getName() == colName) break;
171  }
172  if (atCol == col) [[unlikely]] { return tmp; }
173  for (int32_t r = 0; r < row; ++r) {
174  switch (m_data[r][atCol]->getType()) {
175  case cbMySQLType::String:
177  case cbMySQLType::Date:
178  case cbMySQLType::Time: tmp[hash_string(m_data[r][atCol]->asString())] = r; break;
179  case cbMySQLType::Float: tmp[hash_float(m_data[r][atCol]->asFloat())] = r; break;
180  case cbMySQLType::Double: tmp[hash_double(m_data[r][atCol]->asFloat())] = r; break;
181  case cbMySQLType::Int: tmp[hash_int(m_data[r][atCol]->asInt())] = r; break;
182  case cbMySQLType::ULL: tmp[hash_ull(m_data[r][atCol]->asULL())] = r; break;
183  case cbMySQLType::Null: return tmp;
184  }
185  }
186  return tmp;
187 }
188 
189 void cbVirtualTable::pushRow(const std::vector<cbMySQLCell*>& row) {
190  if (row.size() != m_shape[1]) [[unlikely]] { return; }
191  m_data.push_back(row);
192  m_shape[0]++;
193 }
194 
195 std::string cbVirtualTable::colNameAt(int32_t i) { return m_info[i]->getName(); }
196 
197 std::string cbVirtualTable::colTypeAt(int32_t i) { return datatype2str(m_info[i]->getDataType()); }
198 
200  fmt::print(fg(fmt::color::hot_pink) | fmt::emphasis::italic, "<Table, row={}, col={}>\n",
201  m_shape[0], m_shape[1]);
202 }
203 
205  : m_shape(shape) {
206  int32_t col = m_shape[1];
207  for (int32_t i = 0; i < col; ++i) { m_info.push_back(cbMySQLField(info[i])); }
208 }
209 
211  m_info.clear();
212  m_info.shrink_to_fit();
213  m_shape[0] = 0;
214  m_shape[1] = 0;
215 }
216 
218  clear();
219  m_shape = shape;
220  int32_t col = m_shape[1];
221  m_info.clear();
222  m_info.shrink_to_fit();
223  for (int32_t i = 0; i < col; ++i) { m_info.push_back(cbMySQLField(info[i])); }
224 }
225 
226 std::string cbOutputTableStruct::genKey4Redis(int32_t row, int32_t col) {
227  std::stringstream ss;
228  ss << m_info[col].getTable() << ":" << row << ":" << m_info[col].getName();
229  return ss.str();
230 }
231 
233  virtualT->resetShape(sharedT->getShape());
234  int32_t row = virtualT->getShape()[0];
235  int32_t col = virtualT->getShape()[1];
236 
237  // left value is temp.
238  virtualT->setInfo(sharedT->getInfo());
239  virtualT->resetShape(makeShapeFull(row, col));
240  for (int32_t i = 0; i < row; ++i) {
241  for (int32_t j = 0; j < col; ++j) { virtualT->atPtrRef(i, j) = sharedT->atPtr(i, j); }
242  }
243 }
244 
246 
247 cbMySQLField::cbMySQLField(const protocol::MySQLField* wfPtr) {
248  m_name = wfPtr->get_name();
249  m_orgName = wfPtr->get_org_name();
250  m_table = wfPtr->get_table();
251  m_orgTable = wfPtr->get_org_table();
252  m_db = wfPtr->get_db();
253  m_catalog = wfPtr->get_catalog();
254  m_def = wfPtr->get_def();
255  m_length = wfPtr->get_length();
256  m_flags = wfPtr->get_flags();
257  m_decimals = wfPtr->get_decimals();
258  m_charsetnr = wfPtr->get_charsetnr();
259  m_data_type = wfPtr->get_data_type();
260 }
261 
263  m_name = ptr->getName();
264  m_orgName = ptr->getOrgName();
265  m_table = ptr->getTable();
266  m_orgTable = ptr->getOrgTable();
267  m_db = ptr->getDB();
268  m_catalog = ptr->getCatalog();
269  m_def = ptr->getDef();
270  m_length = ptr->getLength();
271  m_flags = ptr->getFlags();
272  m_decimals = ptr->getDecimals();
273  m_charsetnr = ptr->getCharsetnr();
274  m_data_type = ptr->getDataType();
275 }
276 
277 // get data.
278 std::string cbMySQLField::getName() const { return m_name; }
279 
280 std::string cbMySQLField::getOrgName() const { return m_orgName; }
281 std::string cbMySQLField::getTable() const { return m_table; }
282 std::string cbMySQLField::getOrgTable() const { return m_orgTable; }
283 std::string cbMySQLField::getDB() const { return m_db; }
284 std::string cbMySQLField::getCatalog() const { return m_catalog; }
285 std::string cbMySQLField::getDef() const { return m_def; }
287 int cbMySQLField::getLength() const { return m_length; }
288 int cbMySQLField::getFlags() const { return m_flags; }
289 int cbMySQLField::getDecimals() const { return m_decimals; }
290 int cbMySQLField::getDataType() const { return m_data_type; }
291 
292 // set data.
293 void cbMySQLField::setName(const std::string& value) { m_name = value; }
294 void cbMySQLField::setOrgName(const std::string& value) { m_orgName = value; }
295 void cbMySQLField::setTable(const std::string& value) { m_table = value; }
296 void cbMySQLField::setOrgTable(const std::string& value) { m_orgTable = value; }
297 void cbMySQLField::setDB(const std::string& value) { m_db = value; }
298 void cbMySQLField::setCatalog(const std::string& value) { m_catalog = value; }
299 void cbMySQLField::setDef(const std::string& value) { m_def = value; }
300 void cbMySQLField::setCharsetnr(int32_t value) { m_charsetnr = value; }
301 void cbMySQLField::setLength(int32_t value) { m_length = value; }
302 void cbMySQLField::setFlags(int32_t value) { m_flags = value; }
303 void cbMySQLField::setDecimals(int32_t value) { m_decimals = value; }
304 void cbMySQLField::setDataType(int32_t value) { m_data_type = value; }
305 
306 cbMySQLCell::cbMySQLCell(const protocol::MySQLCell& m) {
307  if (m.is_date()) {
309  m_data = m.as_date();
310  } else if (m.is_datetime()) {
312  m_data = m.as_datetime();
313  } else if (m.is_time()) {
315  m_data = m.as_time();
316  } else if (m.is_float()) {
318  m_data = m.as_float();
319  } else if (m.is_double()) {
321  m_data = m.as_double();
322  } else if (m.is_int()) {
324  m_data = m.as_int();
325  } else if (m.is_string()) {
327  m_data = m.as_string();
328  } else if (m.is_ulonglong()) {
330  m_data = m.as_ulonglong();
331  } else {
333  }
334 }
335 
336 bool cbMySQLCell::isNull() const {
337  switch (m_type) {
338  case cbMySQLType::Null: return true; break;
339  default: return false; break;
340  }
341 }
342 
343 bool cbMySQLCell::isInt() const {
344  switch (m_type) {
345  case cbMySQLType::Int: return true; break;
346  default: return false; break;
347  }
348 }
349 
350 bool cbMySQLCell::isString() const {
351  switch (m_type) {
352  case cbMySQLType::String:
354  case cbMySQLType::Date:
355  case cbMySQLType::Time: return true; break;
356  default: return false; break;
357  }
358 }
359 
360 bool cbMySQLCell::isFloat() const {
361  switch (m_type) {
362  case cbMySQLType::Float: return true; break;
363  default: return false; break;
364  }
365 }
366 
367 bool cbMySQLCell::isDouble() const {
368  switch (m_type) {
369  case cbMySQLType::Double: return true; break;
370  default: return false; break;
371  }
372 }
373 
374 bool cbMySQLCell::isULL() const {
375  switch (m_type) {
376  case cbMySQLType::ULL: return true; break;
377  default: return false; break;
378  }
379 }
380 
381 bool cbMySQLCell::isDate() const {
382  switch (m_type) {
383  case cbMySQLType::Date: return true; break;
384  default: return false; break;
385  }
386 }
387 
388 bool cbMySQLCell::isTime() const {
389  switch (m_type) {
390  case cbMySQLType::Time: return true; break;
391  default: return false; break;
392  }
393 }
394 
396  switch (m_type) {
397  case cbMySQLType::DataTime: return true; break;
398  default: return false; break;
399  }
400 }
401 
402 int cbMySQLCell::asInt() const {
403  if (isInt()) { return std::get<int>(m_data); }
404  return 0;
405 }
406 
407 std::string cbMySQLCell::asString() const {
408  if (isString()) { return std::get<std::string>(m_data); }
409  return "";
410 }
411 
412 float cbMySQLCell::asFloat() const {
413  if (isFloat()) { return std::get<float>(m_data); }
414  return NAN;
415 }
416 
417 double cbMySQLCell::asDouble() const {
418  if (isDouble()) { return std::get<double>(m_data); }
419  return NAN;
420 }
421 
422 unsigned long long cbMySQLCell::asULL() const {
423  if (isULL()) { return std::get<unsigned long long>(m_data); }
424  return 0;
425 }
426 
427 std::string cbMySQLCell::asDate() const { return asString(); }
428 
429 std::string cbMySQLCell::asTime() const { return asString(); }
430 
431 std::string cbMySQLCell::asDatetime() const { return asString(); }
432 
433 void cbMySQLCell::setInt(int value) {
434  if (isInt()) { m_data = value; }
435 }
436 
437 void cbMySQLCell::setString(const std::string& value) {
438  if (isString()) { m_data = value; }
439 }
440 
441 void cbMySQLCell::setFloat(float value) {
442  if (isFloat()) { m_data = value; }
443 }
444 
445 void cbMySQLCell::setDouble(double value) {
446  if (isDouble()) { m_data = value; }
447 }
448 
449 void cbMySQLCell::setULL(unsigned long long value) {
450  if (isULL()) { m_data = value; }
451 }
452 
453 void cbMySQLCell::setDate(const std::string& value) {
454  if (isDate()) { m_data = value; }
455 }
456 
457 void cbMySQLCell::setTime(const std::string& value) {
458  if (isTime()) { m_data = value; }
459 }
460 
461 void cbMySQLCell::setDatetime(const std::string& value) {
462  if (isDatetime()) { m_data = value; }
463 }
464 
466 
467 std::vector<cbMySQLCell*> __luaPackedCellAsVec(cbMySQLCell* v) {
468  if (v)
469  return {v};
470  else
471  return {};
472 }
473 
474 std::vector<std::string> __luaPackedStringAsVec() { return {}; }
cbCell::asBool
bool asBool()
Definition: cbTable.cpp:22
cbOutputTableStruct::m_info
std::vector< cbMySQLField > m_info
Definition: cbTable.hpp:787
cbMySQLField::m_length
int m_length
Definition: cbTable.hpp:457
__luaPackedStringAsVec
std::vector< std::string > __luaPackedStringAsVec()
Definition: cbTable.cpp:474
cbMySQLType::String
@ String
cbMySQLField::getFlags
int getFlags() const
Definition: cbTable.cpp:288
cbMySQLCell::isTime
bool isTime() const
Definition: cbTable.cpp:388
cbVirtualSharedTable::cbVirtualSharedTable
cbVirtualSharedTable()=default
Construct a new cb Virtual Shared Table object.
cbVirtualSharedTable::m_fieldCount
int32_t m_fieldCount
Definition: cbTable.hpp:594
cbVirtualTable::str
void str()
Definition: cbTable.cpp:199
cbMySQLField::getName
std::string getName() const
Definition: cbTable.cpp:278
cbOutputTableStruct::genKey4Redis
std::string genKey4Redis(int32_t row, int32_t col)
Definition: cbTable.cpp:226
cbVirtualTable::m_shape
cbShape< 2 > m_shape
Definition: cbTable.hpp:772
cbMySQLField::setDataType
void setDataType(int32_t value)
Definition: cbTable.cpp:304
cbCell::setAsCppBool
void setAsCppBool(bool rhs)
Definition: cbTable.cpp:38
cbCell::data
__metaObj data
Definition: cbTable.hpp:88
cbVirtualTable::colTypeAt
std::string colTypeAt(int32_t i)
Definition: cbTable.cpp:197
cbMySQLCell::asDate
std::string asDate() const
Definition: cbTable.cpp:427
cbMySQLType::Float
@ Float
cbVirtualTable::atPtr
cbMySQLCell * atPtr(int32_t i, int32_t j)
row major
Definition: cbTable.cpp:128
cbVirtualTable::getInfoAt
cbMySQLField * getInfoAt(int32_t i)
Get the Info At object.
Definition: cbTable.cpp:124
cbVirtualTable::getInfo
cbMySQLField ** getInfo()
Get the Info object.
Definition: cbTable.cpp:115
cbVirtualTable
cbVirtualTable works as a reference from shared memory. It only use a shape and SqlCell to define dif...
Definition: cbTable.hpp:605
cbMySQLCell::isDouble
bool isDouble() const
Definition: cbTable.cpp:367
cbMySQLCell::setDate
void setDate(const std::string &value)
Definition: cbTable.cpp:453
cbMySQLField::getTable
std::string getTable() const
Definition: cbTable.cpp:281
cbOutputTableStruct::clear
void clear()
Definition: cbTable.cpp:210
cbVirtualTable::getRow
cbVirtualTable getRow(int32_t i)
Get the Row object.
Definition: cbTable.cpp:134
cbTable.hpp
the virtual table and shared table.
cbMySQLField::cbMySQLField
cbMySQLField()
Construct a new cb My S Q L Field object.
Definition: cbTable.cpp:245
cbMySQLCell::getType
cbMySQLType getType()
Definition: cbTable.cpp:465
cbMySQLCell::setTime
void setTime(const std::string &value)
Definition: cbTable.cpp:457
cbCell::setAsCppInt
void setAsCppInt(int32_t rhs)
Definition: cbTable.cpp:34
cbMySQLField::getDataType
int getDataType() const
Definition: cbTable.cpp:290
cbMySQLField
A copy move from workflow MySQLResult.h and .inl file.
Definition: cbTable.hpp:404
cbMySQLType::Time
@ Time
cbVirtualSharedTable::atPtr
cbMySQLCell * atPtr(int32_t i, int32_t j)
Definition: cbTable.cpp:77
cbCell::setAsLuaBool
void setAsLuaBool(sol::object rhs)
Definition: cbTable.cpp:30
cbVirtualSharedTable::resetShape
void resetShape(cbShape< 2 > &shape)
Definition: cbTable.cpp:81
cbMySQLCell::asTime
std::string asTime() const
Definition: cbTable.cpp:429
cbVirtualTable::setPtrAt
void setPtrAt(int32_t i, int32_t j, cbMySQLCell *v)
Set the Ptr At object.
Definition: cbTable.cpp:132
cbMySQLCell::isDate
bool isDate() const
Definition: cbTable.cpp:381
cbCell::setAsCppFloat
void setAsCppFloat(float rhs)
Definition: cbTable.cpp:36
cbVirtualSharedTable::atPtrRef
cbMySQLCell * atPtrRef(int32_t i, int32_t j)
Definition: cbTable.cpp:79
cbMySQLField::m_orgName
std::string m_orgName
Definition: cbTable.hpp:451
cbMySQLType::DataTime
@ DataTime
cbMySQLCell::asDouble
double asDouble() const
Definition: cbTable.cpp:417
cbOutputTableStruct::update
void update(const cbShape< 2 > &shape, cbMySQLField **info)
Definition: cbTable.cpp:217
cbCell::asFloat
float asFloat()
Definition: cbTable.cpp:20
cbMySQLCell
Definition: cbTable.hpp:468
cbMySQLField::m_data_type
int m_data_type
Definition: cbTable.hpp:461
cbMySQLCell::isFloat
bool isFloat() const
Definition: cbTable.cpp:360
cbVirtualTable::resetShapeH
void resetShapeH(const cbShape< 2 > &shape)
Definition: cbTable.cpp:109
cbMySQLCell::isDatetime
bool isDatetime() const
Definition: cbTable.cpp:395
cbMySQLCell::isInt
bool isInt() const
Definition: cbTable.cpp:343
cbMySQLCell::setDatetime
void setDatetime(const std::string &value)
Definition: cbTable.cpp:461
cbMySQLCell::m_type
cbMySQLType m_type
Definition: cbTable.hpp:510
mapShared2Virtual
void mapShared2Virtual(cbVirtualSharedTable *sharedT, cbVirtualTable *virtualT)
Definition: cbTable.cpp:232
cbVirtualTable::pushRow
void pushRow(const std::vector< cbMySQLCell * > &row)
Definition: cbTable.cpp:189
cbVirtualTable::setInfoAt
void setInfoAt(int32_t i, cbMySQLField *v)
Set the Info At object.
Definition: cbTable.cpp:119
cbVirtualTable::getCol
cbVirtualTable getCol(int32_t i)
Get the Col object.
Definition: cbTable.cpp:145
cbMySQLCell::asULL
unsigned long long asULL() const
Definition: cbTable.cpp:422
cbMySQLField::m_catalog
std::string m_catalog
Definition: cbTable.hpp:455
cbMySQLField::setTable
void setTable(const std::string &value)
Definition: cbTable.cpp:295
cbMySQLField::getLength
int getLength() const
Definition: cbTable.cpp:287
cbMySQLType::Double
@ Double
cbMySQLField::setOrgName
void setOrgName(const std::string &value)
Definition: cbTable.cpp:294
cbMySQLField::setDef
void setDef(const std::string &value)
Definition: cbTable.cpp:299
cbMySQLCell::isNull
bool isNull() const
Definition: cbTable.cpp:336
cbMySQLField::getOrgTable
std::string getOrgTable() const
Definition: cbTable.cpp:282
cbMySQLField::setDB
void setDB(const std::string &value)
Definition: cbTable.cpp:297
cbMySQLField::getDef
std::string getDef() const
Definition: cbTable.cpp:285
cbMySQLCell::setFloat
void setFloat(float value)
Definition: cbTable.cpp:441
cbMySQLField::setLength
void setLength(int32_t value)
Definition: cbTable.cpp:301
cbCell::asInt
int asInt()
Definition: cbTable.cpp:18
cbVirtualTable::cbVirtualTable
cbVirtualTable()=default
cbMySQLField::getOrgName
std::string getOrgName() const
Definition: cbTable.cpp:280
cbMySQLCell::isULL
bool isULL() const
Definition: cbTable.cpp:374
cbVirtualTable::m_data
std::vector< std::vector< cbMySQLCell * > > m_data
Definition: cbTable.hpp:773
cbMySQLField::m_name
std::string m_name
Definition: cbTable.hpp:450
cbMySQLType::ULL
@ ULL
cbShape< 2 >
cbMySQLField::setName
void setName(const std::string &value)
Definition: cbTable.cpp:293
cbMySQLField::getCharsetnr
int getCharsetnr() const
Definition: cbTable.cpp:286
cbMySQLCell::asInt
int asInt() const
Definition: cbTable.cpp:402
cbVirtualSharedTable::m_info
cbMySQLField ** m_info
Definition: cbTable.hpp:596
cbMySQLCell::isString
bool isString() const
Definition: cbTable.cpp:350
cbMySQLCell::setInt
void setInt(int value)
Definition: cbTable.cpp:433
cbVirtualSharedTable::~cbVirtualSharedTable
~cbVirtualSharedTable()
Destroy the cb Virtual Shared Table object.
Definition: cbTable.cpp:48
cbMySQLField::m_decimals
int m_decimals
Definition: cbTable.hpp:459
cbMySQLField::setCatalog
void setCatalog(const std::string &value)
Definition: cbTable.cpp:298
cbVirtualSharedTable::getInfo
cbMySQLField ** getInfo()
Get the Info object.
Definition: cbTable.hpp:569
cbVirtualSharedTable
cbVirtualSharedTable is a container of shared memory.
Definition: cbTable.hpp:518
cbVirtualTable::m_info
cbMySQLField ** m_info
Definition: cbTable.hpp:771
cbMySQLCell::setString
void setString(const std::string &value)
Definition: cbTable.cpp:437
cbVirtualSharedTable::getShape
const cbShape< 2 > getShape() const
Get the Shape object.
Definition: cbTable.hpp:544
cbVirtualSharedTable::resetFieldInfo
void resetFieldInfo(int32_t fieldCount, cbMySQLField **info)
Definition: cbTable.cpp:91
cbVirtualTable::atPtrRef
cbMySQLCell *& atPtrRef(int32_t i, int32_t j)
Definition: cbTable.cpp:130
cbMySQLField::m_def
std::string m_def
Definition: cbTable.hpp:456
cbCell::setAsCppString
void setAsCppString(std::string rhs)
Definition: cbTable.cpp:40
cbMySQLType::Null
@ Null
cbMySQLField::setDecimals
void setDecimals(int32_t value)
Definition: cbTable.cpp:303
cbVirtualTable::getData
std::vector< std::vector< cbMySQLCell * > > & getData()
Get the Data object.
Definition: cbTable.cpp:126
cbMySQLField::getDB
std::string getDB() const
Definition: cbTable.cpp:283
cbVirtualTable::colNameAt
std::string colNameAt(int32_t i)
Definition: cbTable.cpp:195
cbMySQLType
cbMySQLType
Definition: cbTable.hpp:375
cbMySQLField::m_orgTable
std::string m_orgTable
Definition: cbTable.hpp:453
cbVirtualSharedTable::m_data
std::vector< std::vector< cbMySQLCell > > m_data
Definition: cbTable.hpp:597
cbVirtualTable::resetShape
void resetShape(const cbShape< 2 > &shape)
Definition: cbTable.cpp:98
cbMySQLCell::asDatetime
std::string asDatetime() const
Definition: cbTable.cpp:431
cbMySQLField::m_db
std::string m_db
Definition: cbTable.hpp:454
cbMySQLField::m_table
std::string m_table
Definition: cbTable.hpp:452
cbMySQLField::m_flags
int m_flags
Definition: cbTable.hpp:458
cbMySQLType::Int
@ Int
makeShapeFull
cbShape< 2 > makeShapeFull(int32_t a, int32_t b)
Definition: cbTable.hpp:198
cbMySQLCell::asFloat
float asFloat() const
Definition: cbTable.cpp:412
cbMySQLField::setCharsetnr
void setCharsetnr(int32_t value)
Definition: cbTable.cpp:300
cbCell::setAsLuaInt
void setAsLuaInt(sol::object rhs)
Definition: cbTable.cpp:26
cbCell::setAsLuaString
void setAsLuaString(sol::object rhs)
Definition: cbTable.cpp:32
cbMySQLField::setFlags
void setFlags(int32_t value)
Definition: cbTable.cpp:302
cbVirtualSharedTable::m_shape
cbShape< 2 > m_shape
Definition: cbTable.hpp:595
cbCell::setAsLuaFloat
void setAsLuaFloat(sol::object rhs)
Definition: cbTable.cpp:28
cbOutputTableStruct::cbOutputTableStruct
cbOutputTableStruct()=delete
cbMySQLCell::setDouble
void setDouble(double value)
Definition: cbTable.cpp:445
cbMySQLCell::m_data
__cbMySQLMeta m_data
Definition: cbTable.hpp:511
__luaPackedCellAsVec
std::vector< cbMySQLCell * > __luaPackedCellAsVec(cbMySQLCell *v)
Definition: cbTable.cpp:467
cbMySQLField::getDecimals
int getDecimals() const
Definition: cbTable.cpp:289
cbMySQLCell::cbMySQLCell
cbMySQLCell()
Definition: cbTable.hpp:470
cbMySQLField::setOrgTable
void setOrgTable(const std::string &value)
Definition: cbTable.cpp:296
cbVirtualTable::getShape
cbShape< 2 > getShape()
Get the Shape object.
Definition: cbTable.hpp:687
cbOutputTableStruct::m_shape
cbShape< 2 > m_shape
Definition: cbTable.hpp:786
cbVirtualTable::keyBy
std::map< int32_t, int32_t > keyBy(const std::string &colName) const
Definition: cbTable.cpp:156
cbMySQLCell::asString
std::string asString() const
Definition: cbTable.cpp:407
cbMySQLField::m_charsetnr
int m_charsetnr
Definition: cbTable.hpp:460
cbMySQLField::getCatalog
std::string getCatalog() const
Definition: cbTable.cpp:284
cbCell::asString
std::string & asString()
Definition: cbTable.cpp:24
cbVirtualTable::setInfo
void setInfo(cbMySQLField **v)
Set the Info object.
Definition: cbTable.cpp:117
cbMySQLType::Date
@ Date
cbVirtualTable::m_isInfoExtent
bool m_isInfoExtent
Definition: cbTable.hpp:770
cbMySQLCell::setULL
void setULL(unsigned long long value)
Definition: cbTable.cpp:449