CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::PoolDbCache Class Reference

#include <PoolDatabaseSchema.h>

Public Member Functions

void add (int id, const PoolDbCacheData &data)
 
void clear ()
 
PoolDbCacheDatafind (int id)
 
int idByName (const std::string &name)
 
const std::string & nameById (int id)
 
 PoolDbCache ()
 
void remove (int id)
 
std::map< std::string,
PoolDbCacheData * > & 
sequences ()
 
 ~PoolDbCache ()
 

Private Attributes

PoolDbCacheData m_databaseData
 
std::map< int, PoolDbCacheDatam_idMap
 
PoolDbCacheData m_mappingData
 
std::map< std::string,
PoolDbCacheData * > 
m_sequences
 

Detailed Description

Definition at line 29 of file PoolDatabaseSchema.h.

Constructor & Destructor Documentation

ora::PoolDbCache::PoolDbCache ( )

Definition at line 365 of file PoolDatabaseSchema.cc.

References m_databaseData, m_mappingData, and ora::PoolDbCacheData::m_nobjWr.

365  :
366  m_databaseData(),
367  m_mappingData(),
368  m_idMap(),
369  m_sequences(){
372 }
PoolDbCacheData m_mappingData
PoolDbCacheData m_databaseData
std::map< std::string, PoolDbCacheData * > m_sequences
std::map< int, PoolDbCacheData > m_idMap
ora::PoolDbCache::~PoolDbCache ( )

Definition at line 374 of file PoolDatabaseSchema.cc.

374  {
375 }

Member Function Documentation

void ora::PoolDbCache::add ( int  id,
const PoolDbCacheData data 
)

Definition at line 377 of file PoolDatabaseSchema.cc.

References errorMatrix2Lands_multiChannel::id, ora::PoolDbCacheData::m_name, ora::MappingRules::sequenceNameForContainer(), ora::MappingRules::sequenceNameForContainerId(), and ora::throwException().

377  {
378  std::map<int,PoolDbCacheData >::iterator iData = m_idMap.insert( std::make_pair( id, data )).first;
379  std::map<std::string,PoolDbCacheData*>::iterator iS = m_sequences.find( MappingRules::sequenceNameForContainerId() );
380  if( iS == m_sequences.end() ){
381  throwException( "ContainerId Sequence is empty","PoolDbCache::add");
382  }
383  if( id > (int)iS->second->m_nobjWr ){
384  iS->second->m_nobjWr = id;
385  }
386  m_sequences.insert( std::make_pair( MappingRules::sequenceNameForContainer( data.m_name ),&iData->second ) );
387 }
std::map< std::string, PoolDbCacheData * > m_sequences
std::map< int, PoolDbCacheData > m_idMap
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static std::string sequenceNameForContainer(const std::string &containerName)
Definition: MappingRules.cc:14
static std::string sequenceNameForContainerId()
sequence names
Definition: MappingRules.cc:9
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
void ora::PoolDbCache::clear ( void  )

Definition at line 424 of file PoolDatabaseSchema.cc.

References ora::MappingRules::sequenceNameForContainerId(), and ora::MappingRules::sequenceNameForMapping().

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

424  {
425  m_sequences.clear();
426  m_idMap.clear();
428  m_sequences.insert(std::make_pair( MappingRules::sequenceNameForMapping(), &m_mappingData ) );
429 }
PoolDbCacheData m_mappingData
PoolDbCacheData m_databaseData
std::map< std::string, PoolDbCacheData * > m_sequences
std::map< int, PoolDbCacheData > m_idMap
static std::string sequenceNameForMapping()
Definition: MappingRules.cc:29
static std::string sequenceNameForContainerId()
sequence names
Definition: MappingRules.cc:9
ora::PoolDbCacheData & ora::PoolDbCache::find ( int  id)

Definition at line 406 of file PoolDatabaseSchema.cc.

References ora::throwException().

Referenced by BeautifulSoup.Tag::__getattr__(), and BeautifulSoup.Tag::firstText().

406  {
407  std::map<int,PoolDbCacheData >::iterator iC = m_idMap.find( id );
408  if( iC == m_idMap.end() ){
409  throwException("Container has not been found in the cache.","PoolDbCache::find");
410  }
411  return iC->second;
412 }
std::map< int, PoolDbCacheData > m_idMap
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
int ora::PoolDbCache::idByName ( const std::string &  name)

Definition at line 394 of file PoolDatabaseSchema.cc.

References run_regression::ret.

394  {
395  int ret = -1;
396  for(std::map<int,PoolDbCacheData >::const_iterator iData = m_idMap.begin();
397  iData != m_idMap.end(); iData++ ){
398  if( iData->second.m_name == name ){
399  ret = iData->first;
400  break;
401  }
402  }
403  return ret;
404 }
std::map< int, PoolDbCacheData > m_idMap
const std::string & ora::PoolDbCache::nameById ( int  id)

Definition at line 389 of file PoolDatabaseSchema.cc.

References data, spr::find(), and ora::PoolDbCacheData::m_name.

389  {
390  PoolDbCacheData& data = find( id );
391  return data.m_name;
392 }
PoolDbCacheData & find(int id)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ora::PoolDbCache::remove ( int  id)

Definition at line 414 of file PoolDatabaseSchema.cc.

References spr::find(), mergeVDriftHistosByStation::name, and ora::MappingRules::sequenceNameForContainer().

414  {
415  std::string name = find( id ).m_name;
417  m_idMap.erase( id );
418 }
std::map< std::string, PoolDbCacheData * > m_sequences
std::map< int, PoolDbCacheData > m_idMap
PoolDbCacheData & find(int id)
static std::string sequenceNameForContainer(const std::string &containerName)
Definition: MappingRules.cc:14
std::map< std::string, ora::PoolDbCacheData * > & ora::PoolDbCache::sequences ( )

Definition at line 420 of file PoolDatabaseSchema.cc.

420  {
421  return m_sequences;
422 }
std::map< std::string, PoolDbCacheData * > m_sequences

Member Data Documentation

PoolDbCacheData ora::PoolDbCache::m_databaseData
private

Definition at line 42 of file PoolDatabaseSchema.h.

Referenced by PoolDbCache().

std::map<int,PoolDbCacheData > ora::PoolDbCache::m_idMap
private

Definition at line 44 of file PoolDatabaseSchema.h.

PoolDbCacheData ora::PoolDbCache::m_mappingData
private

Definition at line 43 of file PoolDatabaseSchema.h.

Referenced by PoolDbCache().

std::map<std::string,PoolDbCacheData* > ora::PoolDbCache::m_sequences
private

Definition at line 45 of file PoolDatabaseSchema.h.