CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
cond::persistency::TableDescription< Types > Class Template Reference

#include <DbCore.h>

Public Member Functions

template<typename... ColumnTypes>
void createIndex (const std::string &name)
 
const coral::TableDescription & get ()
 
template<typename Column , typename ReferencedColumn >
void setForeignKey (const std::string &name)
 
template<typename... ColumnTypes>
void setPrimaryKey ()
 
template<typename... ColumnTypes>
void setUniqueConstraint (const std::string &name)
 
 TableDescription (const char *name)
 

Private Member Functions

template<int n>
void _makeList (std::vector< std::string > &)
 
template<int n, typename Arg1 , typename... Args>
void _makeList (std::vector< std::string > &columnNames)
 
template<int n>
void addColumn (coral::TableDescription &)
 
template<int n, typename Arg1 , typename... Args>
void addColumn (coral::TableDescription &tableDescription)
 
template<int , typename Col1 , typename... Cols>
void checkColumns ()
 
template<int >
void checkColumns ()
 
template<typename... ColumnTypes>
std::vector< std::string > makeList ()
 

Private Attributes

coral::TableDescription m_description
 

Detailed Description

template<typename... Types>
class cond::persistency::TableDescription< Types >

Definition at line 247 of file DbCore.h.

Constructor & Destructor Documentation

template<typename... Types>
cond::persistency::TableDescription< Types >::TableDescription ( const char *  name)
inlineexplicit

Definition at line 269 of file DbCore.h.

269  : m_description("ConditionDatabase") {
270  m_description.setName(name);
271  addColumn<0, Types...>(m_description);
272  }
void addColumn(coral::TableDescription &)
Definition: DbCore.h:250
Definition: Types.py:1
coral::TableDescription m_description
Definition: DbCore.h:319

Member Function Documentation

template<typename... Types>
template<int n>
void cond::persistency::TableDescription< Types >::_makeList ( std::vector< std::string > &  )
inlineprivate

Definition at line 303 of file DbCore.h.

References dqmiodumpmetadata::n.

303 {}
template<typename... Types>
template<int n, typename Arg1 , typename... Args>
void cond::persistency::TableDescription< Types >::_makeList ( std::vector< std::string > &  columnNames)
inlineprivate

Definition at line 306 of file DbCore.h.

References Skims_PA_cff::name.

306  {
307  columnNames.push_back(Arg1::name);
308  _makeList<n + 1, Args...>(columnNames);
309  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:303
template<typename... Types>
template<int n>
void cond::persistency::TableDescription< Types >::addColumn ( coral::TableDescription< Types > &  )
inlineprivate

Definition at line 250 of file DbCore.h.

References dqmiodumpmetadata::n.

250 {}
template<typename... Types>
template<int n, typename Arg1 , typename... Args>
void cond::persistency::TableDescription< Types >::addColumn ( coral::TableDescription< Types > &  tableDescription)
inlineprivate

Definition at line 253 of file DbCore.h.

References createfilelist::int, Skims_PA_cff::name, findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.

253  {
254  std::string columnName(Arg1::name);
255  f_add_column_description<typename Arg1::type>(m_description, columnName, Arg1::size);
256  addColumn<n + 1, Args...>(m_description);
257  }
size
Write out results.
void addColumn(coral::TableDescription &)
Definition: DbCore.h:250
coral::TableDescription m_description
Definition: DbCore.h:319
template<typename... Types>
template<int , typename Col1 , typename... Cols>
void cond::persistency::TableDescription< Types >::checkColumns ( )
inlineprivate

Definition at line 260 of file DbCore.h.

260  {
261  static_assert(is_same_any<Col1, Types...>(), "Specified Column has not been found in the table.");
262  checkColumns<0, Cols...>();
263  }
template<typename... Types>
template<int >
void cond::persistency::TableDescription< Types >::checkColumns ( )
inlineprivate

Definition at line 266 of file DbCore.h.

266 {}
template<typename... Types>
template<typename... ColumnTypes>
void cond::persistency::TableDescription< Types >::createIndex ( const std::string &  name)
inline

Definition at line 288 of file DbCore.h.

288  {
289  checkColumns<0, ColumnTypes...>();
290  m_description.createIndex(name, makeList<ColumnTypes...>());
291  }
coral::TableDescription m_description
Definition: DbCore.h:319
template<typename... Types>
const coral::TableDescription& cond::persistency::TableDescription< Types >::get ( )
inline
template<typename... Types>
template<typename... ColumnTypes>
std::vector<std::string> cond::persistency::TableDescription< Types >::makeList ( )
inlineprivate

Definition at line 312 of file DbCore.h.

312  {
313  std::vector<std::string> columnList;
314  _makeList<0, ColumnTypes...>(columnList);
315  return columnList;
316  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:303
template<typename... Types>
template<typename Column , typename ReferencedColumn >
void cond::persistency::TableDescription< Types >::setForeignKey ( const std::string &  name)
inline

Definition at line 294 of file DbCore.h.

References Skims_PA_cff::name, and HLT_2018_cff::tableName.

Referenced by cond::persistency::IOV::Table::create(), and cond::persistency::TAG_LOG::Table::create().

294  {
295  checkColumns<0, Column>();
297  }
coral::TableDescription m_description
Definition: DbCore.h:319
template<typename... Types>
template<typename... ColumnTypes>
void cond::persistency::TableDescription< Types >::setPrimaryKey ( )
inline
template<typename... Types>
template<typename... ColumnTypes>
void cond::persistency::TableDescription< Types >::setUniqueConstraint ( const std::string &  name)
inline

Definition at line 282 of file DbCore.h.

282  {
283  checkColumns<0, ColumnTypes...>();
284  m_description.setUniqueConstraint(makeList<ColumnTypes...>(), name);
285  }
coral::TableDescription m_description
Definition: DbCore.h:319

Member Data Documentation

template<typename... Types>
coral::TableDescription cond::persistency::TableDescription< Types >::m_description
private

Definition at line 319 of file DbCore.h.