CMS 3D CMS Logo

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

#include <IOVSchema.h>

Inheritance diagram for cond::persistency::TAG::Table:
cond::persistency::ITagTable

Public Member Functions

void create () override
 
bool exists () override
 
bool getMetadata (const std::string &name, std::string &description, boost::posix_time::ptime &insertionTime, boost::posix_time::ptime &modificationTime) override
 
void insert (const std::string &name, cond::TimeType timeType, const std::string &objectType, cond::SynchronizationType synchronizationType, cond::Time_t endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &insertionTime) override
 
bool select (const std::string &name) override
 
bool select (const std::string &name, cond::TimeType &timeType, std::string &objectType, cond::SynchronizationType &synchronizationType, cond::Time_t &endOfValidity, std::string &description, cond::Time_t &lastValidatedTime) override
 
void setValidationMode () override
 
 Table (coral::ISchema &schema)
 
void update (const std::string &name, cond::SynchronizationType synchronizationType, cond::Time_t &endOfValidity, const std::string &description, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime) override
 
void updateValidity (const std::string &name, cond::Time_t lastValidatedTime, const boost::posix_time::ptime &updateTime) override
 
 ~Table () override
 
- Public Member Functions inherited from cond::persistency::ITagTable
virtual ~ITagTable ()
 

Private Attributes

coral::ISchema & m_schema
 

Detailed Description

Definition at line 25 of file IOVSchema.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file IOVSchema.cc.

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

35  :
36  m_schema( schema ){
37  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
cond::persistency::TAG::Table::~Table ( )
inlineoverride

Member Function Documentation

void Table::create ( )
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 43 of file IOVSchema.cc.

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

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

43  {
44  if( exists() ){
45  throwException( "TAG table already exists in this schema.",
46  "TAG::Table::create");
47  }
48  TableDescription< NAME, TIME_TYPE, OBJECT_TYPE, SYNCHRONIZATION, END_OF_VALIDITY, DESCRIPTION, LAST_VALIDATED_TIME, INSERTION_TIME, MODIFICATION_TIME > descr( tname );
49  descr.setPrimaryKey<NAME>();
50  createTable( m_schema, descr.get() );
51  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
static char const * tname
Definition: IOVSchema.h:13
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
bool cond::persistency::TAG::Table::exists ( )
overridevirtual
bool Table::getMetadata ( const std::string &  name,
std::string &  description,
boost::posix_time::ptime &  insertionTime,
boost::posix_time::ptime &  modificationTime 
)
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 75 of file IOVSchema.cc.

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

78  {
79  Query< DESCRIPTION, INSERTION_TIME, MODIFICATION_TIME > q( m_schema );
80  q.addCondition<NAME>( name );
81  for ( auto row : q ) std::tie( description, insertionTime, modificationTime ) = row;
82  return q.retrievedRows();
83  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
void Table::insert ( const std::string &  name,
cond::TimeType  timeType,
const std::string &  objectType,
cond::SynchronizationType  synchronizationType,
cond::Time_t  endOfValidity,
const std::string &  description,
cond::Time_t  lastValidatedTime,
const boost::posix_time::ptime &  insertionTime 
)
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 85 of file IOVSchema.cc.

References cond::persistency::RowBuffer< Columns >::get(), m_schema, and cond::persistency::TAG::tname.

Referenced by BeautifulSoup.PageElement::append().

92  {
93  RowBuffer< NAME, TIME_TYPE, OBJECT_TYPE, SYNCHRONIZATION, END_OF_VALIDITY, DESCRIPTION, LAST_VALIDATED_TIME, INSERTION_TIME, MODIFICATION_TIME >
94  dataToInsert( std::tie( name, timeType, objectType, synchronizationType, endOfValidity, description, lastValidatedTime, insertionTime, insertionTime ) );
95  insertInTable( m_schema, tname, dataToInsert.get() );
96  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
static char const * tname
Definition: IOVSchema.h:13
bool Table::select ( const std::string &  name)
overridevirtual
bool Table::select ( const std::string &  name,
cond::TimeType timeType,
std::string &  objectType,
cond::SynchronizationType synchronizationType,
cond::Time_t endOfValidity,
std::string &  description,
cond::Time_t lastValidatedTime 
)
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 61 of file IOVSchema.cc.

References cond::persistency::Query< Types >::addCondition(), m_schema, dataset::name, 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(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

67  {
68  Query< TIME_TYPE, OBJECT_TYPE, SYNCHRONIZATION, END_OF_VALIDITY, DESCRIPTION, LAST_VALIDATED_TIME > q( m_schema );
69  q.addCondition<NAME>( name );
70  for ( auto row : q ) std::tie( timeType, objectType, synchronizationType, endOfValidity, description, lastValidatedTime ) = row;
71 
72  return q.retrievedRows();
73  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
void cond::persistency::TAG::Table::setValidationMode ( )
inlineoverridevirtual

Implements cond::persistency::ITagTable.

Definition at line 42 of file IOVSchema.h.

42 {}
void Table::update ( const std::string &  name,
cond::SynchronizationType  synchronizationType,
cond::Time_t endOfValidity,
const std::string &  description,
cond::Time_t  lastValidatedTime,
const boost::posix_time::ptime &  updateTime 
)
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 98 of file IOVSchema.cc.

References cond::persistency::UpdateBuffer::addWhereCondition(), edmScanValgrind::buffer, m_schema, dataset::name, cond::persistency::UpdateBuffer::setColumnData(), and cond::persistency::TAG::tname.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

103  {
104  UpdateBuffer buffer;
105  buffer.setColumnData< SYNCHRONIZATION, END_OF_VALIDITY, DESCRIPTION, LAST_VALIDATED_TIME, MODIFICATION_TIME >( std::tie( synchronizationType,
106  endOfValidity,
107  description,
108  lastValidatedTime,
109  updateTime ) );
110  buffer.addWhereCondition<NAME>( name );
111  updateTable( m_schema, tname, buffer );
112  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
static char const * tname
Definition: IOVSchema.h:13
void Table::updateValidity ( const std::string &  name,
cond::Time_t  lastValidatedTime,
const boost::posix_time::ptime &  updateTime 
)
overridevirtual

Implements cond::persistency::ITagTable.

Definition at line 114 of file IOVSchema.cc.

References cond::persistency::UpdateBuffer::addWhereCondition(), edmScanValgrind::buffer, m_schema, dataset::name, cond::persistency::UpdateBuffer::setColumnData(), and cond::persistency::TAG::tname.

116  {
117  UpdateBuffer buffer;
118  buffer.setColumnData< LAST_VALIDATED_TIME, MODIFICATION_TIME >( std::tie( lastValidatedTime, updateTime ) );
119  buffer.addWhereCondition<NAME>( name );
120  updateTable( m_schema, tname, buffer );
121  }
coral::ISchema & m_schema
Definition: IOVSchema.h:44
static char const * tname
Definition: IOVSchema.h:13

Member Data Documentation

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

Definition at line 44 of file IOVSchema.h.

Referenced by create(), getMetadata(), insert(), select(), Table(), update(), and updateValidity().