|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef CONDDBOBJECTS_GENERICDBTABLE_H
6 #define CONDDBOBJECTS_GENERICDBTABLE_H
15 #include "GaudiKernel/DataObject.h"
84 int getTypes(std::vector<dataTypes> &types)
const;
90 int getNull(
unsigned n_column,
float &
null)
const;
91 int getNull(
unsigned n_column,
long int &
null)
const;
93 int getNull(
unsigned n_column,
double &
null)
const;
94 int getNull(
unsigned n_column, std::string &
null)
const;
103 int setName(
unsigned n_column,
const std::string&
name);
118 int setNull(
unsigned n_column,
const float &
null);
119 int setNull(
unsigned n_column,
const long int &
null);
121 int setNull(
unsigned n_column,
const double &
null);
122 int setNull(
unsigned n_column,
const std::string &
null);
131 void Initialize(
unsigned n_columns,
int n_rows=0);
142 int getRow(
unsigned rowNumber, std::vector<std::string> &
values)
const;
151 int getRowID(std::string &pID)
const;
165 int getCell(
unsigned n_column,
unsigned n_row,
short int &ndata)
const;
175 int getCell(
unsigned n_column,
unsigned n_row,
long int &ndata)
const ;
185 int getCell(
unsigned n_column,
unsigned n_row,
int64 &ndata)
const ;
195 int getCell(
unsigned n_column,
unsigned n_row,
float &ndata)
const;
205 int getCell(
unsigned n_column,
unsigned n_row, std::string &ndata)
const;
215 int getCell(
unsigned n_column,
unsigned n_row,
double &ndata)
const;
225 int getCell(
unsigned n_column,
unsigned n_row, std::vector<short int> &ndata)
const;
235 int getCell(
unsigned n_column,
unsigned n_row, std::vector<long int> &ndata)
const;
245 int getCell(
unsigned n_column,
unsigned n_row, std::vector<int64> &ndata)
const;
255 int getCell(
unsigned n_column,
unsigned n_row, std::vector<float> &ndata)
const;
265 int getCell(
unsigned n_column,
unsigned n_row, std::vector<std::string> &ndata)
const;
275 int getCell(
unsigned n_column,
unsigned n_row, std::vector<double> &ndata)
const;
286 int getCell(
const std::string& colName,
unsigned int n_row,
short int &
data)
const;
287 int getCell(
const std::string& colName,
unsigned int n_row,
long int &
data)
const;
288 int getCell(
const std::string& colName,
unsigned int n_row,
int64 &
data)
const;
289 int getCell(
const std::string& colName,
unsigned int n_row,
float &
data)
const;
290 int getCell(
const std::string& colName,
unsigned int n_row,
double &
data)
const;
291 int getCell(
const std::string& colName,
unsigned int n_row, std::string &
data)
const;
292 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<short int> &
data)
const;
293 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<long int> &
data)
const;
294 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<int64> &
data)
const;
295 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<float> &
data)
const;
296 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<double> &
data)
const;
297 int getCell(
const std::string& colName,
unsigned int n_row, std::vector<std::string> &
data)
const;
315 int setCell(
unsigned n_column,
unsigned n_row,
const short int ndata);
325 int setCell(
unsigned n_column,
unsigned n_row,
const long int ndata);
335 int setCell(
unsigned n_column,
unsigned n_row,
const int64 ndata);
345 int setCell(
unsigned n_column,
unsigned n_row,
const float ndata);
355 int setCell(
unsigned n_column,
unsigned n_row,
const std::string& ndata);
365 int setCell(
unsigned n_column,
unsigned n_row,
const double ndata);
375 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<short int> &ndata);
385 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<long int> &ndata);
395 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<int64> &ndata);
405 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<float> &ndata);
415 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<std::string> &ndata);
425 int setCell(
unsigned n_column,
unsigned n_row,
const std::vector<double> &ndata);
504 int setColumndata(
unsigned n_column,
const std::vector<std::vector<short int> > &
data);
514 int setColumndata(
unsigned n_column,
const std::vector<std::vector<long int> > &
data);
524 int setColumndata(
unsigned n_column,
const std::vector<std::vector<int64> > &
data);
544 int setColumndata(
unsigned n_column,
const std::vector<std::vector<std::string> > &
data);
563 void resize(
int num_rows);
594 template <
typename T,
typename COLUMN>
597 data = tmpColumn->column[0];
608 template <
typename T,
typename COLUMN>
617 template <
typename T,
typename COLUMN>
626 template <
typename T,
typename COLUMN>
635 template <
typename T>
650 template <
class TYPE>
653 std::ostringstream
os;
704 std::vector<std::vector<short int> >
column;
714 std::vector<std::vector<long int> >
column;
724 std::vector<std::vector<std::string> >
column;
729 std::vector<std::vector<double> >
column;
Definition of the columns.
char data[hepevt_bytes_allocation_ATLAS]
std::vector< std::vector< std::string > > column
int __getCell(unsigned n_column, unsigned n_row, T &ndata, dataTypes type, COLUMN *tmpColumn) const
Templated method that get's the data from a specified cell This is the method that does the real work...
int setColumndata(unsigned n_column, const std::vector< double > &data)
Insert a subset in a column of doubles.
~GenericDbTable()
Object destructor.
int __setCell(unsigned n_column, unsigned n_row, const T &ndata, dataTypes type, COLUMN *tmpColumn)
Templated method that set's the data in a specified cell This is the method that does the real work.
std::vector< int64 > column
int __getCellByName(const std::string &colName, unsigned int n_row, T &data) const
Templated method that get's column data using the column name This method get's the desired column nu...
int getCell(unsigned n_column, unsigned n_row, std::vector< float > &ndata) const
This method gets a value from a cell in a column of vectors of floats.
std::vector< std::vector< double > > column
std::vector< short int > column
int __getNull(T &data, COLUMN *tmpColumn) const
Templated method for handling the null values.
std::vector< float > column
std::string ToString(const TYPE &t) const
Auxiliary function to convert any value to string.
std::vector< std::string > column
int setNull(unsigned n_column, const float &null)
Set Null value for column.
std::vector< CondDBColumn * > m_conddbtable
int getNames(std::vector< std::string > &names) const
This method gets a vector containing the names of all columns in the table.
std::vector< long int > column
void Initialize(unsigned n_columns, int n_rows=0)
This method initializes a table created by the default constructor If the table had the number of col...
void resize(int num_rows)
Reserves more rows on the table.
int setName(unsigned n_column, const std::string &name)
This method defines the name for a specified column.
int setColumndata(unsigned n_column, const std::vector< std::vector< double > > &data)
Insert a subset in a column of vectors of doubles.
int getRow(unsigned rowNumber, std::vector< std::string > &values) const
This method returns a vector of strings with allelements in a row In case the cell has an array the f...
std::vector< std::vector< int64 > > column
std::vector< std::vector< float > > column
int setType(unsigned n_column, dataTypes type)
This method defines the data type for a specified column.
int getRowID(std::string &pID) const
This method returns, for a given ID, the row number.
int __setColumnData(unsigned n_column, T &data, dataTypes type, COLUMN *tmpColumn)
Templated method that set's portions of data in a specified column This method is deprecated and henc...
int getTypes(std::vector< dataTypes > &types) const
This method gets a vector containing the data types of all columns in the table.
int setCell(unsigned n_column, unsigned n_row, const short int ndata)
set data methods
std::vector< double > column
unsigned getNumRows() const
Returns the number of rows RESERVED in the table.
int setColumndata(unsigned n_column, const std::vector< float > &data)
Insert a subset in a column of floats.
#define TYPE(CODE, TYP, IOTYP)
int getCell(unsigned n_column, unsigned n_row, short int &ndata) const
This method gets a value from a cell in a column of long ints (int in MySQL)
int setColumndata(unsigned n_column, const std::vector< std::vector< float > > &data)
Insert a subset in a column of vectors of floats.
void verifyInitialization()
Verifies if all columns are initialized.
int getNull(unsigned n_column, float &null) const
Get Null value for column.
std::vector< std::vector< short int > > column
int getCell(unsigned n_column, unsigned n_row, std::vector< double > &ndata) const
This method gets a value from a cell in a column of vector of doubles.
int setColumndata(unsigned n_column, const std::vector< short int > &data)
The following methods allow to insert in the columns a group of values.
unsigned getNumColumns() const
Returns the number of columns in the table.
GenericDbTable()
Default constructor.
int setCell(unsigned n_column, unsigned n_row, const std::vector< float > &ndata)
This method changes a value from a cell in a column of vectors of floats.
int setCell(unsigned n_column, unsigned n_row, const std::vector< double > &ndata)
This method changes a value from a cell in a column of vectors of doubles.
std::vector< std::vector< long int > > column