CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cond::persistency::GLOBAL_TAG_MAP::Table Class Reference

#include <GTSchema.h>

Inheritance diagram for cond::persistency::GLOBAL_TAG_MAP::Table:
cond::persistency::IGTMapTable

Public Member Functions

void create () override
 
bool exists () override
 
void insert (const std::string &gtName, const std::vector< std::tuple< std::string, std::string, std::string > > &tags) override
 
bool select (const std::string &gtName, std::vector< std::tuple< std::string, std::string, std::string > > &tags) override
 
bool select (const std::string &gtName, const std::string &preFix, const std::string &postFix, std::vector< std::tuple< std::string, std::string, std::string > > &tags) override
 
 Table (coral::ISchema &schema)
 
 ~Table () override
 
- Public Member Functions inherited from cond::persistency::IGTMapTable
virtual ~IGTMapTable ()
 

Private Attributes

coral::ISchema & m_schema
 

Detailed Description

Definition at line 52 of file GTSchema.h.

Constructor & Destructor Documentation

Table::Table ( coral::ISchema &  schema)
explicit

Definition at line 79 of file GTSchema.cc.

79  :
80  m_schema( schema ){
81  }
cond::persistency::GLOBAL_TAG_MAP::Table::~Table ( )
inlineoverride

Member Function Documentation

void Table::create ( )
overridevirtual

Implements cond::persistency::IGTMapTable.

Definition at line 87 of file GTSchema.cc.

References exists(), cond::persistency::TableDescription< Types >::get(), m_schema, cond::persistency::TableDescription< Types >::setPrimaryKey(), cond::persistency::throwException(), and cond::persistency::GLOBAL_TAG_MAP::tname.

Referenced by cond::persistency::GTSchema::create(), and o2olib.O2OTool::execute().

87  {
88  if( exists() ){
89  throwException( "GLOBAL_TAG_MAP table already exists in this schema.",
90  "GLOBAL_TAG_MAP::Table::create");
91  }
92  TableDescription< GLOBAL_TAG_NAME, RECORD, LABEL, TAG_NAME > descr( tname );
93  descr.setPrimaryKey< GLOBAL_TAG_NAME, RECORD, LABEL >();
94  createTable( m_schema, descr.get() );
95  }
static char const * tname
Definition: GTSchema.h:41
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
bool Table::exists ( )
overridevirtual

Implements cond::persistency::IGTMapTable.

Definition at line 83 of file GTSchema.cc.

References m_schema, and cond::persistency::GLOBAL_TAG_MAP::tname.

Referenced by create(), and cond::persistency::GTSchema::exists().

83  {
84  return existsTable( m_schema, tname );
85  }
static char const * tname
Definition: GTSchema.h:41
void Table::insert ( const std::string &  gtName,
const std::vector< std::tuple< std::string, std::string, std::string > > &  tags 
)
overridevirtual

Implements cond::persistency::IGTMapTable.

Definition at line 117 of file GTSchema.cc.

References cond::persistency::BulkInserter< Types >::flush(), cond::persistency::BulkInserter< Types >::insert(), m_schema, and cond::persistency::GLOBAL_TAG_MAP::tname.

Referenced by BeautifulSoup.PageElement::append().

118  {
119  BulkInserter<GLOBAL_TAG_NAME, RECORD, LABEL, TAG_NAME > inserter( m_schema, tname );
120  for( auto row : tags ) inserter.insert( std::tuple_cat( std::tie( gtName ),row ) );
121  inserter.flush();
122  }
static char const * tname
Definition: GTSchema.h:41
bool Table::select ( const std::string &  gtName,
std::vector< std::tuple< std::string, std::string, std::string > > &  tags 
)
overridevirtual

Implements cond::persistency::IGTMapTable.

Definition at line 97 of file GTSchema.cc.

References cond::persistency::Query< Types >::addCondition(), cond::persistency::Query< Types >::addOrderClause(), m_schema, and lumiQueryAPI::q.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.AbstractView.AbstractView::restoreSelection(), and select().

98  {
99  Query< RECORD, LABEL, TAG_NAME > q( m_schema );
100  q.addCondition< GLOBAL_TAG_NAME >( gtName );
101  q.addOrderClause<RECORD>();
102  q.addOrderClause<LABEL>();
103  for ( auto row : q ) {
104  if ( std::get<1>(row) == "-" ) {
105  std::get<1>(row) = "";
106  }
107  tags.push_back( row );
108  }
109  return q.retrievedRows();
110  }
bool Table::select ( const std::string &  gtName,
const std::string &  preFix,
const std::string &  postFix,
std::vector< std::tuple< std::string, std::string, std::string > > &  tags 
)
overridevirtual

Member Data Documentation

coral::ISchema& cond::persistency::GLOBAL_TAG_MAP::Table::m_schema
private

Definition at line 63 of file GTSchema.h.

Referenced by create(), exists(), insert(), and select().