#include <PoolDatabaseSchema.h>
Public Member Functions | |
void | add (int id, const PoolDbCacheData &data) |
void | clear () |
PoolDbCacheData & | find (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, PoolDbCacheData > | m_idMap |
PoolDbCacheData | m_mappingData |
std::map< std::string, PoolDbCacheData * > | m_sequences |
Definition at line 29 of file PoolDatabaseSchema.h.
ora::PoolDbCache::PoolDbCache | ( | ) |
Definition at line 365 of file PoolDatabaseSchema.cc.
References m_databaseData, m_mappingData, and ora::PoolDbCacheData::m_nobjWr.
: m_databaseData(), m_mappingData(), m_idMap(), m_sequences(){ m_databaseData.m_nobjWr = 1; m_mappingData.m_nobjWr = 1; }
ora::PoolDbCache::~PoolDbCache | ( | ) |
Definition at line 374 of file PoolDatabaseSchema.cc.
{ }
void ora::PoolDbCache::add | ( | int | id, |
const PoolDbCacheData & | data | ||
) |
Definition at line 377 of file PoolDatabaseSchema.cc.
References ora::PoolDbCacheData::m_name, ora::MappingRules::sequenceNameForContainer(), ora::MappingRules::sequenceNameForContainerId(), and ora::throwException().
{ std::map<int,PoolDbCacheData >::iterator iData = m_idMap.insert( std::make_pair( id, data )).first; std::map<std::string,PoolDbCacheData*>::iterator iS = m_sequences.find( MappingRules::sequenceNameForContainerId() ); if( iS == m_sequences.end() ){ throwException( "ContainerId Sequence is empty","PoolDbCache::add"); } if( id > (int)iS->second->m_nobjWr ){ iS->second->m_nobjWr = id; } m_sequences.insert( std::make_pair( MappingRules::sequenceNameForContainer( data.m_name ),&iData->second ) ); }
void ora::PoolDbCache::clear | ( | void | ) |
Definition at line 424 of file PoolDatabaseSchema.cc.
References ora::MappingRules::sequenceNameForContainerId(), and ora::MappingRules::sequenceNameForMapping().
{ m_sequences.clear(); m_idMap.clear(); m_sequences.insert(std::make_pair( MappingRules::sequenceNameForContainerId(), &m_databaseData ) ); m_sequences.insert(std::make_pair( MappingRules::sequenceNameForMapping(), &m_mappingData ) ); }
ora::PoolDbCacheData & ora::PoolDbCache::find | ( | int | id | ) |
Definition at line 406 of file PoolDatabaseSchema.cc.
References ora::throwException().
{ std::map<int,PoolDbCacheData >::iterator iC = m_idMap.find( id ); if( iC == m_idMap.end() ){ throwException("Container has not been found in the cache.","PoolDbCache::find"); } return iC->second; }
int ora::PoolDbCache::idByName | ( | const std::string & | name | ) |
Definition at line 394 of file PoolDatabaseSchema.cc.
References runTheMatrix::ret.
const std::string & ora::PoolDbCache::nameById | ( | int | id | ) |
Definition at line 389 of file PoolDatabaseSchema.cc.
References AlCaHLTBitMon_QueryRunRegistry::data, spr::find(), and ora::PoolDbCacheData::m_name.
void ora::PoolDbCache::remove | ( | int | id | ) |
Definition at line 414 of file PoolDatabaseSchema.cc.
References spr::find(), mergeVDriftHistosByStation::name, and ora::MappingRules::sequenceNameForContainer().
{ std::string name = find( id ).m_name; m_sequences.erase( MappingRules::sequenceNameForContainer( name ) ); m_idMap.erase( id ); }
std::map< std::string, ora::PoolDbCacheData * > & ora::PoolDbCache::sequences | ( | ) |
Definition at line 420 of file PoolDatabaseSchema.cc.
{ return m_sequences; }
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.
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.