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 285 of file DbCore.h.

Constructor & Destructor Documentation

◆ TableDescription()

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

Member Function Documentation

◆ _makeList() [1/2]

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

◆ _makeList() [2/2]

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 344 of file DbCore.h.

344  {
345  columnNames.push_back(Arg1::name);
346  _makeList<n + 1, Args...>(columnNames);
347  }

References cond::persistency::TableDescription< Types >::_makeList(), dqmiodumpmetadata::n, and Skims_PA_cff::name.

◆ addColumn() [1/2]

template<typename... Types>
template<int n>
void cond::persistency::TableDescription< Types >::addColumn ( coral::TableDescription< Types > &  )
inlineprivate

◆ addColumn() [2/2]

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

◆ checkColumns() [1/2]

template<typename... Types>
template<int , typename Col1 , typename... Cols>
void cond::persistency::TableDescription< Types >::checkColumns ( )
inlineprivate

Definition at line 298 of file DbCore.h.

298  {
299  static_assert(is_same_any<Col1, Types...>(), "Specified Column has not been found in the table.");
300  checkColumns<0, Cols...>();
301  }

Referenced by cond::persistency::TableDescription< Types >::createIndex(), cond::persistency::TableDescription< Types >::setPrimaryKey(), and cond::persistency::TableDescription< Types >::setUniqueConstraint().

◆ checkColumns() [2/2]

template<typename... Types>
template<int >
void cond::persistency::TableDescription< Types >::checkColumns ( )
inlineprivate

Definition at line 304 of file DbCore.h.

304 {}

◆ createIndex()

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

Definition at line 326 of file DbCore.h.

326  {
327  checkColumns<0, ColumnTypes...>();
328  m_description.createIndex(name, makeList<ColumnTypes...>());
329  }

References cond::persistency::TableDescription< Types >::checkColumns(), cond::persistency::TableDescription< Types >::m_description, and Skims_PA_cff::name.

◆ get()

template<typename... Types>
const coral::TableDescription& cond::persistency::TableDescription< Types >::get ( )
inline

◆ makeList()

template<typename... Types>
template<typename... ColumnTypes>
std::vector<std::string> cond::persistency::TableDescription< Types >::makeList ( )
inlineprivate

Definition at line 350 of file DbCore.h.

350  {
351  std::vector<std::string> columnList;
352  _makeList<0, ColumnTypes...>(columnList);
353  return columnList;
354  }

References cond::persistency::TableDescription< Types >::_makeList().

◆ setForeignKey()

template<typename... Types>
template<typename Column , typename ReferencedColumn >
void cond::persistency::TableDescription< Types >::setForeignKey ( const std::string &  name)
inline

◆ setPrimaryKey()

template<typename... Types>
template<typename... ColumnTypes>
void cond::persistency::TableDescription< Types >::setPrimaryKey ( )
inline

◆ setUniqueConstraint()

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

Definition at line 320 of file DbCore.h.

320  {
321  checkColumns<0, ColumnTypes...>();
322  m_description.setUniqueConstraint(makeList<ColumnTypes...>(), name);
323  }

References cond::persistency::TableDescription< Types >::checkColumns(), cond::persistency::TableDescription< Types >::m_description, and Skims_PA_cff::name.

Member Data Documentation

◆ m_description

template<typename... Types>
coral::TableDescription cond::persistency::TableDescription< Types >::m_description
private
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HLT_2018_cff.tableName
tableName
Definition: HLT_2018_cff.py:10
cond::persistency::TableDescription::m_description
coral::TableDescription m_description
Definition: DbCore.h:357
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Types
Definition: Types.py:1
cond::persistency::TableDescription::_makeList
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:341
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cond::persistency::TableDescription::checkColumns
void checkColumns()
Definition: DbCore.h:298
cond::persistency::TableDescription::addColumn
void addColumn(coral::TableDescription &)
Definition: DbCore.h:288
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443