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

Constructor & Destructor Documentation

◆ TableDescription()

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

Definition at line 308 of file DbCore.h.

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

308  : m_description("ConditionDatabase") {
309  m_description.setName(name);
310  addColumn<0, Types...>(m_description);
311  }
void addColumn(coral::TableDescription &)
Definition: DbCore.h:289
Definition: Types.py:1
coral::TableDescription m_description
Definition: DbCore.h:358

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

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

345  {
346  columnNames.push_back(Arg1::name);
347  _makeList<n + 1, Args...>(columnNames);
348  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:342

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

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

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

◆ checkColumns() [2/2]

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

Definition at line 305 of file DbCore.h.

305 {}

◆ createIndex()

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

Definition at line 327 of file DbCore.h.

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

327  {
328  checkColumns<0, ColumnTypes...>();
329  m_description.createIndex(name, makeList<ColumnTypes...>());
330  }
coral::TableDescription m_description
Definition: DbCore.h:358

◆ get()

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

Definition at line 338 of file DbCore.h.

References cond::persistency::TableDescription< Types >::m_description.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), data_sources.json_list::as_dicts(), data_sources.json_list::as_table(), rrapi.RRApi::columns(), util.rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), cond::persistency::GLOBAL_TAG::Table::create(), cond::persistency::RUN_INFO::Table::create(), cond::persistency::GLOBAL_TAG_MAP::Table::create(), cond::persistency::PAYLOAD::Table::create(), cond::persistency::IOV::Table::create(), cond::persistency::TAG_AUTHORIZATION::Table::create(), cond::persistency::TAG_LOG::Table::create(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), data_sources.json_list::first(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), data_sources.json_list::indices(), data_sources.json_list::last(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

338 { return m_description; }
coral::TableDescription m_description
Definition: DbCore.h:358

◆ makeList()

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

Definition at line 351 of file DbCore.h.

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

351  {
352  std::vector<std::string> columnList;
353  _makeList<0, ColumnTypes...>(columnList);
354  return columnList;
355  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:342

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

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

321  {
322  checkColumns<0, ColumnTypes...>();
323  m_description.setUniqueConstraint(makeList<ColumnTypes...>(), name);
324  }
coral::TableDescription m_description
Definition: DbCore.h:358

Member Data Documentation

◆ m_description

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