#include <HltStoreSvc.h>
Public Member Functions | |
bool | clear (void) |
bool | clear (void) |
bool | erase (const std::string &name) |
bool | erase (const std::string &name) |
bool | exists (const std::string &name) |
bool | exists (const std::string &name) |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
template<class T> | |
bool | get (const std::string &name, T &value) |
template<class T> | |
bool | get (const std::string &name, T &value) |
HltStoreSvc (const std::string &name, ISvcLocator *sl) | |
HltStoreSvc (const std::string &name, ISvcLocator *sl) | |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
int | max_size () |
int | max_size () |
void | printKeys () |
void | printKeys () |
template<class T> | |
bool | put (const std::string &name, const T &value) |
template<class T> | |
bool | put (const std::string &name, const T &value) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvIF) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvIF) |
int | size () |
int | size () |
string | sListLength () |
string | sListLength () |
~HltStoreSvc () | |
~HltStoreSvc () | |
Static Public Member Functions | |
const InterfaceID & | interfaceID () |
const InterfaceID & | interfaceID () |
Protected Types | |
typedef map< string, BaseHolder * > | ContainerType |
typedef map< string, BaseHolder * > | ContainerType |
Protected Attributes | |
ContainerType | m_map |
Private Attributes | |
HltStoreSvc * | m_HltStore |
HltStoreSvc * | m_HltStore |
|
|
|
|
|
00015 : Service(name, sl) 00016 { }
|
|
00019 { }
|
|
|
|
|
|
00108 { 00109 for (ContainerType::iterator it = m_map.begin(); it != m_map.end(); it++) { 00110 delete (*it).second; 00111 } 00112 m_map.erase(m_map.begin(), m_map.end()); 00113 return true; 00114 }
|
|
00108 { 00109 for (ContainerType::iterator it = m_map.begin(); it != m_map.end(); it++) { 00110 delete (*it).second; 00111 } 00112 m_map.erase(m_map.begin(), m_map.end()); 00113 return true; 00114 }
|
|
00095 { 00096 ContainerType::iterator it = m_map.find(name); 00097 if(it != m_map.end()) { 00098 delete (*it).second; 00099 m_map.erase(it); 00100 return true; 00101 } 00102 return false; 00103 }
|
|
00095 { 00096 ContainerType::iterator it = m_map.find(name); 00097 if(it != m_map.end()) { 00098 delete (*it).second; 00099 m_map.erase(it); 00100 return true; 00101 } 00102 return false; 00103 }
|
|
|
|
|
|
|
|
00052 { 00053 ContainerType::iterator pos; 00054 for (pos = m_map.begin(); pos != m_map.end(); ++pos) { 00055 // delete (*pos).second; 00056 } 00057 m_map.erase(m_map.begin(),m_map.end()); 00058 return StatusCode::SUCCESS; 00059 }
|
|
00076 { 00077 //std::cout << "HltStoreSvc::get() "<<"start"<<std::endl; 00078 ContainerType::iterator it = m_map.find(name); 00079 //std::cout << "HltStoreSvc::get() "<<"middle"<<std::endl; 00080 if(it != m_map.end()) { 00081 if(Holder<T>* ptr = static_cast<Holder<T>* >((*it).second)) { 00082 value = ptr->value(); 00083 return true; 00084 } 00085 } 00086 //std::cout << "HltStoreSvc::get() "<<"end"<<std::endl; 00087 return false; 00088 }
|
|
00076 { 00077 //std::cout << "HltStoreSvc::get() "<<"start"<<std::endl; 00078 ContainerType::iterator it = m_map.find(name); 00079 //std::cout << "HltStoreSvc::get() "<<"middle"<<std::endl; 00080 if(it != m_map.end()) { 00081 if(Holder<T>* ptr = static_cast<Holder<T>* >((*it).second)) { 00082 value = ptr->value(); 00083 return true; 00084 } 00085 } 00086 //std::cout << "HltStoreSvc::get() "<<"end"<<std::endl; 00087 return false; 00088 }
|
|
|
|
00033 { 00034 StatusCode sc; 00035 00036 MsgStream log(messageService(), name()); 00037 log << MSG::INFO << name() << ": Start of run initialisation" << endreq; 00038 00039 sc = Service::initialize(); 00040 if ( sc.isFailure() ) return sc; 00041 00042 sc = service( "HltStoreSvc", m_HltStore); 00043 if( sc.isFailure() ) { 00044 log<<MSG::WARNING<<"Unable to get service HltStore"<<endreq; 00045 return sc; 00046 } 00047 log << MSG::DEBUG << "(*p)" << (unsigned int)m_HltStore << endreq; 00048 return StatusCode::SUCCESS; 00049 }
|
|
00032 { return IID_IHltStoreSvc; }
|
|
00032 { return IID_IHltStoreSvc; }
|
|
|
|
00075 { 00076 return m_map.max_size(); 00077 }
|
|
|
|
00064 { 00065 ContainerType::iterator pos; 00066 for (pos = m_map.begin(); pos != m_map.end(); ++pos) { 00067 cout << pos->first << endl; 00068 } 00069 }
|
|
00060 { 00061 Holder<T> *ptr = new Holder<T>(value); 00062 if(BaseHolder *old = m_map[name]) { 00063 std::cout << "demanded key already exists, overwrite old one" << std::endl; 00064 delete old; 00065 } 00066 m_map[name] = ptr; 00067 return true; 00068 }
|
|
00060 { 00061 Holder<T> *ptr = new Holder<T>(value); 00062 if(BaseHolder *old = m_map[name]) { 00063 std::cout << "demanded key already exists, overwrite old one" << std::endl; 00064 delete old; 00065 } 00066 m_map[name] = ptr; 00067 return true; 00068 }
|
|
|
|
00022 { 00023 if ( IID_IHltStoreSvc.versionMatch(riid) ) { 00024 // *ppvIF = static_cast<IHltStoreSvc*> (this); 00025 *ppvIF = (HltStoreSvc*)this; 00026 } else { 00027 return Service::queryInterface(riid, ppvIF) ; 00028 } 00029 return StatusCode::SUCCESS; 00030 }
|
|
|
|
00071 { 00072 return m_map.size(); 00073 }
|
|
|
|
00084 { 00085 unsigned int iListLength = this->size(); 00086 iListLength += 1; 00087 ostrstream ListLength; 00088 00089 //convert integer into std::string 00090 ListLength << iListLength; 00091 ListLength << '\0'; 00092 string stringListLength = ListLength.str(); 00093 if (this->exists(stringListLength)){ 00094 stringListLength = "unset"; 00095 for (int i = 0; i < this->max_size(); i++){ 00096 iListLength += 1; 00097 ListLength << iListLength; 00098 ListLength << '\0'; 00099 stringListLength = ListLength.str(); 00100 if (!(this->exists(stringListLength))) { 00101 ListLength.freeze(0); 00102 return stringListLength; 00103 } 00104 } 00105 } 00106 00107 ListLength.freeze(0); 00108 return stringListLength; 00109 }
|
|
|
|
|
|
|