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");
439 vector<long int>
tmp;
465 vector<short int>
tmp;
492 tmp.push_back(
"NULL");
567 vector<long int>
tmp(1,atol(
null.c_str()));
583 vector<int64>
tmp(1,
atoi64(
null.c_str()));
618 vector<long int>
tmp(1,
null);
641 vector<int64>
tmp(1,
null);
828 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
840 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
855 return __getCellByName<long int>(colName, n_row,
data);
859 return __getCellByName<int64>(colName, n_row,
data);
863 return __getCellByName<float>(colName,n_row,
data);
867 return __getCellByName<double>(colName, n_row,
data);
871 return __getCellByName<std::string>(colName, n_row,
data);
875 return __getCellByName< std::vector<short int> >(colName, n_row,
data);
879 return __getCellByName<std::vector<long int> >(colName, n_row,
data);
883 return __getCellByName<std::vector<int64> >(colName, n_row,
data);
887 return __getCellByName<std::vector<float> >(colName, n_row,
data);
891 return __getCellByName<std::vector<double> >(colName, n_row,
data);
895 return __getCellByName<std::vector<string> >(colName, n_row,
data);
954 __setCell(n_column, n_row, atol(ndata.c_str()),
kInt, tmpColumn);
997 __setCell(n_column,n_row, strtod(ndata.c_str(), (
char **)NULL),
kFloat, tmpColumn);
1011 __setCell(n_column,n_row,strtod(ndata.c_str(), (
char **)NULL),
kDouble, tmpColumn);
1052 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
1058 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
1084 vector<long int>
tmp;
1085 for (
unsigned i=0;
i<ndata.size();
i++)
1087 if (ndata[
i]==
"NULL")
1091 tmp.push_back(
null);
1094 tmp.push_back(atol(ndata[
i].c_str()));
1102 vector<short int>
tmp;
1103 for (
unsigned i=0;
i<ndata.size();
i++)
1105 if (ndata[
i]==
"NULL")
1110 tmp.push_back(
atoi(ndata[
i].c_str()));
1119 for (
unsigned i=0;
i<ndata.size();
i++)
1121 if (ndata[
i]==
"NULL")
1125 tmp.push_back(
null);
1138 for (
unsigned i=0;
i<ndata.size();
i++)
1140 if (ndata[
i]==
"NULL")
1144 tmp.push_back(
null);
1147 tmp.push_back(
atof(ndata[
i].c_str()));
1156 for (
unsigned i=0;
i<ndata.size();
i++)
1158 if (ndata[
i]==
"NULL")
1162 tmp.push_back(
null);
1165 tmp.push_back(strtod(ndata[
i].c_str(), (
char**)NULL));
1211 CondDBColumnFloat *tmpColumn =
static_cast<CondDBColumnFloat*
>(
m_conddbtable[n_column]);
1242 vector<long int>
tmp;
1243 for (
unsigned i=0;
i<
data.size();
i++)
1245 if (
data[
i]==
"NULL")
1249 tmp.push_back(
null);
1252 tmp.push_back(atol(
data[
i].c_str()));
1259 vector<short int>
tmp;
1260 for (
unsigned i=0;
i<
data.size();
i++)
1262 if (
data[
i]==
"NULL")
1264 short int null = -1;
1265 tmp.push_back(
null);
1276 for (
unsigned i=0;
i<
data.size();
i++)
1278 if (
data[
i]==
"NULL")
1282 tmp.push_back(
null);
1293 for (
unsigned i=0;
i<
data.size();
i++)
1295 if (
data[
i]==
"NULL")
1299 tmp.push_back(
null);
1310 for (
unsigned i=0;
i<
data.size();
i++)
1312 if (
data[
i]==
"NULL")
1316 tmp.push_back(
null);
1319 tmp.push_back(strtod(
data[
i].c_str(), (
char**)NULL));
1327 vector<long int>
tmp;
1328 for (
unsigned i=0;
i<
data.size();
i++)
1330 if (
data[
i]==
"NULL")
1334 tmp.push_back(
null);
1337 tmp.push_back(atol(
data[
i].c_str()));
1344 vector<short int>
tmp;
1345 for (
unsigned i=0;
i<
data.size();
i++)
1347 if (
data[
i]==
"NULL")
1350 short int null = -1;
1351 tmp.push_back(
null);
1362 for (
unsigned i=0;
i<
data.size();
i++)
1364 if (
data[
i]==
"NULL")
1368 tmp.push_back(
null);
1379 for (
unsigned i=0;
i<
data.size();
i++)
1381 if (
data[
i]==
"NULL")
1385 tmp.push_back(
null);
1396 for (
unsigned i=0;
i<
data.size();
i++)
1398 if (
data[
i]==
"NULL")
1402 tmp.push_back(
null);
1405 tmp.push_back(strtod(
data[
i].c_str(), (
char**)NULL));
1423 CondDBColumnDouble *tmpColumn =
static_cast<CondDBColumnDouble*
>(
m_conddbtable[n_column]);
1447 CondDBColumnArrayFloat *tmpColumn =
static_cast<CondDBColumnArrayFloat*
>(
m_conddbtable[n_column]);
1453 CondDBColumnArrayDouble *tmpColumn =
static_cast<CondDBColumnArrayDouble*
>(
m_conddbtable[n_column]);
1483 vector<vector<long int> > aux;
1484 for (
unsigned j=0; j<
data.size(); j++)
1486 vector<long int>
tmp;
1487 for (
unsigned i=0;
i<
data[j].size();
i++)
1489 if (
data[j][
i]==
"NULL")
1493 tmp.push_back(
null);
1496 tmp.push_back(atol(
data[j][
i].c_str()));
1505 vector<vector<int64> > aux;
1506 for (
unsigned j=0; j<
data.size(); j++)
1509 for (
unsigned i=0;
i<
data[j].size();
i++)
1511 if (
data[j][
i]==
"NULL")
1515 tmp.push_back(
null);
1527 vector<vector<short int> > aux;
1528 for (
unsigned j=0; j<
data.size(); j++)
1530 vector<short int>
tmp;
1531 for (
unsigned i=0;
i<
data[j].size();
i++)
1533 if (
data[j][
i]==
"NULL")
1547 vector<vector<float> > aux;
1548 for (
unsigned j=0; j<
data.size(); j++)
1551 for (
unsigned i=0;
i<
data[j].size();
i++)
1553 if (
data[j][
i]==
"NULL")
1557 tmp.push_back(
null);
1569 vector<vector<double> > aux;
1570 for (
unsigned j=0; j<
data.size(); j++)
1573 for (
unsigned i=0;
i<
data[j].size();
i++)
1575 if (
data[j][
i]==
"NULL")
1579 tmp.push_back(
null);
1582 tmp.push_back(strtod(
data[j][
i].c_str(), (
char**)NULL));
1628 values.push_back(ToString<long int>(
tmp));
1635 values.push_back(ToString<short int>(
tmp));
1657 values.push_back(ToString<string>(
tmp));
1665 values.push_back(ToString<double>(
tmp));
1671 vector<long int>
tmp;
1685 vector<short int>
tmp;
1780 template <
typename T,
typename COLUMN>
1791 if (tmpColumn->column.size() <= n_row)
1792 ndata = tmpColumn->column.back();
1794 ndata = tmpColumn->column[n_row+1];
1806 template <
typename T,
typename COLUMN>
1817 if (tmpColumn->column.size() == (n_row+1))
1818 tmpColumn->column.push_back(ndata);
1820 if (tmpColumn->column.size() < (n_row+1))
1822 T tmp = tmpColumn->column.back();
1824 while((n_row)-tmpColumn->column.size())
1826 tmpColumn->column.push_back(
tmp);
1828 tmpColumn->column.push_back(ndata);
1832 tmpColumn->column[n_row+1] = ndata;
1843 template <
typename T,
typename COLUMN>
1856 tmpColumn->column.push_back(
data[
index]);
1869 template <
typename T>