11 #define NULLINT -INT_MAX
12 #define NULLFLOAT -FLT_MAX
13 #define NULLDOUBLE -DBL_MAX
16 #define NULLLONG -__LONG_LONG_MAX__
18 #define NULLLONG -LONG_LONG_MAX
20 #define atoi64(x) atoll(x)
35 for (
i=0;
i<n_columns;
i++)
68 for (
i=0;
i<n_columns;
i++)
113 std::vector<std::string>
names;
114 unsigned int ncolumn = 0;
117 ncolumn = std::count_if(
names.begin(),
names.end(), [](
const auto &
s){return s !=
"Id";} );
120 if (ncolumn ==
names.size())
125 for (
unsigned int i = 0;
i < dcolumn->
column.size();
i++) {
126 if (dcolumn->
column[
i] == pID) {
164 null = ToString<float>(
tmp);
172 null = ToString<float>(
tmp[0]);
180 null = ToString<float>(
tmp);
185 vector<long int>
tmp;
275 vector<long int>
tmp;
369 tmpColumn->
column.push_back(-1);
415 tmpColumn->
column.push_back(
"NULL");
461 tmpColumn->
column.push_back({-1});
484 tmp.push_back(
"NULL");
485 tmpColumn->
column.push_back({
"NULL"});
809 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
821 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
836 return __getCellByName<long int>(colName, n_row,
data);
840 return __getCellByName<int64>(colName, n_row,
data);
844 return __getCellByName<float>(colName,n_row,
data);
848 return __getCellByName<double>(colName, n_row,
data);
852 return __getCellByName<std::string>(colName, n_row,
data);
856 return __getCellByName< std::vector<short int> >(colName, n_row,
data);
860 return __getCellByName<std::vector<long int> >(colName, n_row,
data);
864 return __getCellByName<std::vector<int64> >(colName, n_row,
data);
868 return __getCellByName<std::vector<float> >(colName, n_row,
data);
872 return __getCellByName<std::vector<double> >(colName, n_row,
data);
876 return __getCellByName<std::vector<string> >(colName, n_row,
data);
935 __setCell(n_column, n_row, atol(ndata.c_str()),
kInt, tmpColumn);
978 __setCell(n_column,n_row, strtod(ndata.c_str(), (
char **)NULL),
kFloat, tmpColumn);
992 __setCell(n_column,n_row,strtod(ndata.c_str(), (
char **)NULL),
kDouble, tmpColumn);
1033 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
1039 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
1065 vector<long int>
tmp;
1066 for (
unsigned i=0;
i<ndata.size();
i++)
1068 if (ndata[
i]==
"NULL")
1072 tmp.push_back(
null);
1075 tmp.push_back(atol(ndata[
i].c_str()));
1083 vector<short int>
tmp;
1084 for (
unsigned i=0;
i<ndata.size();
i++)
1086 if (ndata[
i]==
"NULL")
1091 tmp.push_back(
atoi(ndata[
i].c_str()));
1100 for (
unsigned i=0;
i<ndata.size();
i++)
1102 if (ndata[
i]==
"NULL")
1106 tmp.push_back(
null);
1119 for (
unsigned i=0;
i<ndata.size();
i++)
1121 if (ndata[
i]==
"NULL")
1125 tmp.push_back(
null);
1128 tmp.push_back(
atof(ndata[
i].c_str()));
1137 for (
unsigned i=0;
i<ndata.size();
i++)
1139 if (ndata[
i]==
"NULL")
1143 tmp.push_back(
null);
1146 tmp.push_back(strtod(ndata[
i].c_str(), (
char**)NULL));
1192 CondDBColumnFloat *tmpColumn =
static_cast<CondDBColumnFloat*
>(
m_conddbtable[n_column]);
1223 vector<long int>
tmp;
1224 for (
unsigned i=0;
i<
data.size();
i++)
1226 if (
data[
i]==
"NULL")
1230 tmp.push_back(
null);
1233 tmp.push_back(atol(
data[
i].c_str()));
1240 vector<short int>
tmp;
1241 for (
unsigned i=0;
i<
data.size();
i++)
1243 if (
data[
i]==
"NULL")
1245 short int null = -1;
1246 tmp.push_back(
null);
1257 for (
unsigned i=0;
i<
data.size();
i++)
1259 if (
data[
i]==
"NULL")
1263 tmp.push_back(
null);
1274 for (
unsigned i=0;
i<
data.size();
i++)
1276 if (
data[
i]==
"NULL")
1280 tmp.push_back(
null);
1291 for (
unsigned i=0;
i<
data.size();
i++)
1293 if (
data[
i]==
"NULL")
1297 tmp.push_back(
null);
1300 tmp.push_back(strtod(
data[
i].c_str(), (
char**)NULL));
1308 vector<long int>
tmp;
1309 for (
unsigned i=0;
i<
data.size();
i++)
1311 if (
data[
i]==
"NULL")
1315 tmp.push_back(
null);
1318 tmp.push_back(atol(
data[
i].c_str()));
1325 vector<short int>
tmp;
1326 for (
unsigned i=0;
i<
data.size();
i++)
1328 if (
data[
i]==
"NULL")
1331 short int null = -1;
1332 tmp.push_back(
null);
1343 for (
unsigned i=0;
i<
data.size();
i++)
1345 if (
data[
i]==
"NULL")
1349 tmp.push_back(
null);
1360 for (
unsigned i=0;
i<
data.size();
i++)
1362 if (
data[
i]==
"NULL")
1366 tmp.push_back(
null);
1377 for (
unsigned i=0;
i<
data.size();
i++)
1379 if (
data[
i]==
"NULL")
1383 tmp.push_back(
null);
1386 tmp.push_back(strtod(
data[
i].c_str(), (
char**)NULL));
1404 CondDBColumnDouble *tmpColumn =
static_cast<CondDBColumnDouble*
>(
m_conddbtable[n_column]);
1428 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
1434 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
1464 vector<vector<long int> > aux;
1465 for (
unsigned j=0; j<
data.size(); j++)
1467 vector<long int>
tmp;
1468 for (
unsigned i=0;
i<
data[j].size();
i++)
1470 if (
data[j][
i]==
"NULL")
1474 tmp.push_back(
null);
1477 tmp.push_back(atol(
data[j][
i].c_str()));
1479 aux.push_back(std::move(
tmp));
1486 vector<vector<int64> > aux;
1487 for (
unsigned j=0; j<
data.size(); j++)
1490 for (
unsigned i=0;
i<
data[j].size();
i++)
1492 if (
data[j][
i]==
"NULL")
1496 tmp.push_back(
null);
1501 aux.push_back(std::move(
tmp));
1508 vector<vector<short int> > aux;
1509 for (
unsigned j=0; j<
data.size(); j++)
1511 vector<short int>
tmp;
1512 for (
unsigned i=0;
i<
data[j].size();
i++)
1514 if (
data[j][
i]==
"NULL")
1521 aux.push_back(std::move(
tmp));
1528 vector<vector<float> > aux;
1529 for (
unsigned j=0; j<
data.size(); j++)
1532 for (
unsigned i=0;
i<
data[j].size();
i++)
1534 if (
data[j][
i]==
"NULL")
1538 tmp.push_back(
null);
1543 aux.push_back(std::move(
tmp));
1550 vector<vector<double> > aux;
1551 for (
unsigned j=0; j<
data.size(); j++)
1554 for (
unsigned i=0;
i<
data[j].size();
i++)
1556 if (
data[j][
i]==
"NULL")
1560 tmp.push_back(
null);
1563 tmp.push_back(strtod(
data[j][
i].c_str(), (
char**)NULL));
1565 aux.push_back(std::move(
tmp));
1609 values.push_back(ToString<long int>(
tmp));
1616 values.push_back(ToString<short int>(
tmp));
1638 values.push_back(ToString<string>(
tmp));
1646 values.push_back(ToString<double>(
tmp));
1652 vector<long int>
tmp;
1666 vector<short int>
tmp;
1761 template <
typename T,
typename COLUMN>
1772 if (tmpColumn->column.size() <= n_row)
1773 ndata = tmpColumn->column.back();
1775 ndata = tmpColumn->column[n_row+1];
1787 template <
typename T,
typename COLUMN>
1798 if (tmpColumn->column.size() == (n_row+1))
1799 tmpColumn->column.push_back(ndata);
1801 if (tmpColumn->column.size() < (n_row+1))
1803 T tmp = tmpColumn->column.back();
1805 while((n_row)-tmpColumn->column.size())
1807 tmpColumn->column.push_back(
tmp);
1809 tmpColumn->column.push_back(ndata);
1813 tmpColumn->column[n_row+1] = ndata;
1824 template <
typename T,
typename COLUMN>
1837 tmpColumn->column.push_back(
data[
index]);
1850 template <
typename T>