21 m_dbExists.first =
false;
22 m_dbExists.second =
false;
24 iCont != m_containersById.end(); iCont++ ){
25 iCont->second.clear();
28 m_containersById.clear();
29 m_containersByName.clear();
32 m_namedRefCache.clear();
33 m_dropPermission.first =
false;
34 m_dropPermission.second =
false;
38 m_dbExists.first =
true;
39 m_dbExists.second = exists;
43 return m_dbExists.first;
47 return m_dbExists.second;
53 m_containersById.insert( std::make_pair(
id, contPtr ) );
54 m_containersByName.insert( std::make_pair( name,
id ) );
59 m_containersById.erase(
id );
60 m_containersByName.erase( name );
65 std::map<int, Handle<DatabaseContainer> >::iterator iCont = m_containersById.find(
id );
66 if( iCont != m_containersById.end() ){
67 instance = iCont->second;
74 std::map<std::string, int>::iterator iId = m_containersByName.find( name );
75 if( iId == m_containersByName.end() ){
78 return getContainer( iId->second );
82 return m_containersById;
86 m_dbExists.second =
true;
87 m_dbExists.second =
false;
88 m_containersById.clear();
89 m_containersByName.clear();
91 m_namedRefCache.clear();
92 m_dropPermission.first =
false;
93 m_dropPermission.second =
false;
117 std::vector<std::string> namesToDelete;
118 for( std::map<
std::string,boost::weak_ptr<void> >::const_iterator iEntry = m_namedRefCache.begin();
119 iEntry != m_namedRefCache.end(); iEntry++ ){
120 if( iEntry->second.expired() ) namesToDelete.push_back( iEntry->first );
122 for( std::vector<std::string>::const_iterator iName = namesToDelete.begin();
123 iName != namesToDelete.end(); iName++ ){
124 m_namedRefCache.erase( *iName );
129 boost::shared_ptr<void>&
data ){
130 m_namedRefCache.insert( std::make_pair( name, boost::weak_ptr<void>(data) ) );
134 cleanUpNamedRefCache();
135 boost::shared_ptr<void>
ret;
136 std::map<std::string,boost::weak_ptr<void> >::const_iterator iEntry = m_namedRefCache.find( name );
137 if( iEntry != m_namedRefCache.end() ){
138 ret = iEntry->second.lock();
144 m_dropPermission.first =
true;
145 m_dropPermission.second = allowed;
149 return m_dropPermission.first;
153 return m_dropPermission.second;
void eraseContainer(int id, const std::string &name)
Handle< DatabaseContainer > getContainer(int id)
tuple ret
prodAgent to be discontinued
void setUtility(Handle< DatabaseUtilitySession > &utility)
virtual ~TransactionCache()
static PFTauRenderPlugin instance
void addContainer(int id, const std::string &name, Handle< DatabaseContainer > &contPtr)
Handle< DatabaseUtilitySession > utility()
void setDbExists(bool exists)
const std::map< int, Handle< DatabaseContainer > > & containers()
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
boost::shared_ptr< void > getNamedReference(const std::string &name)
void setDropPermission(bool allowed)
void cleanUpNamedRefCache()
bool dropPermissionLoaded()
char data[epos_bytes_allocation]
void setNamedReference(const std::string &name, boost::shared_ptr< void > &data)
volatile std::atomic< bool > shutdown_flag false
std::map< std::string, std::string > & dbParams()