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

Constructor & Destructor Documentation

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

Definition at line 235 of file DbCore.h.

235  :
236  m_description( "ConditionDatabase" ){
237  m_description.setName( name );
238  addColumn<0,Types...>( m_description );
239  }
void addColumn(coral::TableDescription &)
Definition: DbCore.h:218
Definition: Types.py:1
coral::TableDescription m_description
Definition: DbCore.h:281

Member Function Documentation

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

Definition at line 267 of file DbCore.h.

267 {}
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 269 of file DbCore.h.

References dataset::name.

269  {
270  columnNames.push_back( Arg1::name );
271  _makeList<n+1, Args...>( columnNames );
272  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:267
template<typename... Types>
template<int n>
void cond::persistency::TableDescription< Types >::addColumn ( coral::TableDescription< Types > &  )
inlineprivate

Definition at line 218 of file DbCore.h.

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

Definition at line 220 of file DbCore.h.

References dataset::name, findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.

220  {
221  std::string columnName( Arg1::name );
222  f_add_column_description<typename Arg1::type>( m_description, columnName, Arg1::size );
223  addColumn<n+1, Args...>( m_description );
224  }
size
Write out results.
void addColumn(coral::TableDescription &)
Definition: DbCore.h:218
coral::TableDescription m_description
Definition: DbCore.h:281
template<typename... Types>
template<int , typename Col1 , typename... Cols>
void cond::persistency::TableDescription< Types >::checkColumns ( )
inlineprivate

Definition at line 226 of file DbCore.h.

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

Definition at line 231 of file DbCore.h.

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

Definition at line 252 of file DbCore.h.

252  {
253  checkColumns<0,ColumnTypes...>();
254  m_description.createIndex( name, makeList<ColumnTypes...>() );
255  }
coral::TableDescription m_description
Definition: DbCore.h:281
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 274 of file DbCore.h.

274  {
275  std::vector<std::string> columnList;
276  _makeList<0,ColumnTypes...>( columnList );
277  return columnList;
278  }
void _makeList(std::vector< std::string > &)
Definition: DbCore.h:267
template<typename... Types>
template<typename Column , typename ReferencedColumn >
void cond::persistency::TableDescription< Types >::setForeignKey ( const std::string &  name)
inline

Definition at line 257 of file DbCore.h.

References dataset::name.

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

257  {
258  checkColumns<0,Column>();
259  m_description.createForeignKey( name, Column::name, ReferencedColumn::tableName(), ReferencedColumn::name );
260  }
coral::TableDescription m_description
Definition: DbCore.h:281
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 247 of file DbCore.h.

247  {
248  checkColumns<0,ColumnTypes...>();
249  m_description.setUniqueConstraint( makeList<ColumnTypes...>(), name );
250  }
coral::TableDescription m_description
Definition: DbCore.h:281

Member Data Documentation

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

Definition at line 281 of file DbCore.h.