#include <Sequences.h>
Public Member Functions | |
void | clear () |
void | create (const std::string &sequenceName) |
void | erase (const std::string &sequenceName) |
int | getNextId (const std::string &sequenceName, bool sinchronize=false) |
Sequences (ISequenceTable &table) | |
Sequences (IDatabaseSchema &dbSchema) | |
void | sinchronize (const std::string &sequenceName) |
void | sinchronizeAll () |
virtual | ~Sequences () |
Private Attributes | |
std::map< std::string, int > | m_lastIds |
ISequenceTable & | m_table |
Definition at line 13 of file Sequences.h.
ora::Sequences::Sequences | ( | ora::IDatabaseSchema & | schema | ) | [explicit] |
Definition at line 5 of file Sequences.cc.
: m_lastIds(), m_table( schema.sequenceTable()){ }
ora::Sequences::Sequences | ( | ora::ISequenceTable & | table | ) | [explicit] |
Definition at line 10 of file Sequences.cc.
ora::Sequences::~Sequences | ( | ) | [virtual] |
Definition at line 15 of file Sequences.cc.
{ }
void ora::Sequences::clear | ( | void | ) |
Definition at line 67 of file Sequences.cc.
{ m_lastIds.clear(); }
void ora::Sequences::create | ( | const std::string & | sequenceName | ) |
Definition at line 18 of file Sequences.cc.
References SurfaceDeformation::add().
{ m_table.add( sequenceName ); }
void ora::Sequences::erase | ( | const std::string & | sequenceName | ) |
Definition at line 63 of file Sequences.cc.
{ m_table.erase( sequenceName ); }
int ora::Sequences::getNextId | ( | const std::string & | sequenceName, |
bool | sinchronize = false |
||
) |
Definition at line 22 of file Sequences.cc.
References newFWLiteAna::found, GetRecoTauVFromDQM_MC_cff::next, and ora::throwException().
{ int next = 0; std::map<std::string,int>::iterator iS = m_lastIds.find( sequenceName ); if( iS == m_lastIds.end() ){ bool found = m_table.getLastId( sequenceName, next ); if( ! found ) { throwException("Sequence \""+sequenceName+"\" does not exists.","Sequences::getNextId"); } else { next += 1; } m_lastIds.insert( std::make_pair( sequenceName, next )); } else { next = ++iS->second; } if( sinchronize){ m_table.sinchronize( sequenceName, next ); } return next; }
void ora::Sequences::sinchronize | ( | const std::string & | sequenceName | ) |
Definition at line 43 of file Sequences.cc.
References edm::second().
void ora::Sequences::sinchronizeAll | ( | ) |
Definition at line 53 of file Sequences.cc.
References hitfit::clear(), and edm::second().
std::map<std::string, int> ora::Sequences::m_lastIds [private] |
Definition at line 25 of file Sequences.h.
ISequenceTable& ora::Sequences::m_table [private] |
Definition at line 26 of file Sequences.h.