Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

HltStoreSvc Class Reference

#include <HltStoreSvc.h>

List of all members.

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

HltStoreSvcm_HltStore
HltStoreSvcm_HltStore


Member Typedef Documentation

typedef map<string, BaseHolder*> HltStoreSvc::ContainerType [protected]
 

typedef map<string, BaseHolder*> HltStoreSvc::ContainerType [protected]
 


Constructor & Destructor Documentation

HltStoreSvc::HltStoreSvc const std::string &  name,
ISvcLocator *  sl
 

00015                                                                  : Service(name, sl) 
00016 { }

HltStoreSvc::~HltStoreSvc  ) 
 

00019 { }

HltStoreSvc::HltStoreSvc const std::string &  name,
ISvcLocator *  sl
 

HltStoreSvc::~HltStoreSvc  ) 
 


Member Function Documentation

bool HltStoreSvc::clear void   )  [inline]
 

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   }

bool HltStoreSvc::clear void   )  [inline]
 

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   }

bool HltStoreSvc::erase const std::string &  name  )  [inline]
 

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   }

bool HltStoreSvc::erase const std::string &  name  )  [inline]
 

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   }

bool HltStoreSvc::exists const std::string &  name  ) 
 

bool HltStoreSvc::exists const std::string &  name  ) 
 

00114                                               {
00115   return (m_map.find(name) != m_map.end());
00116 }

virtual StatusCode HltStoreSvc::finalize  )  [virtual]
 

StatusCode HltStoreSvc::finalize  )  [virtual]
 

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 }

template<class T>
bool HltStoreSvc::get const std::string &  name,
T &  value
[inline]
 

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   }

template<class T>
bool HltStoreSvc::get const std::string &  name,
T &  value
[inline]
 

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   }

virtual StatusCode HltStoreSvc::initialize  )  [virtual]
 

StatusCode HltStoreSvc::initialize  )  [virtual]
 

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 }

const InterfaceID& HltStoreSvc::interfaceID  )  [inline, static]
 

00032 { return IID_IHltStoreSvc; }

const InterfaceID& HltStoreSvc::interfaceID  )  [inline, static]
 

00032 { return IID_IHltStoreSvc; }

int HltStoreSvc::max_size  ) 
 

int HltStoreSvc::max_size  ) 
 

00075                          {
00076   return m_map.max_size();
00077 }

void HltStoreSvc::printKeys  ) 
 

void HltStoreSvc::printKeys  ) 
 

00064                            {
00065   ContainerType::iterator pos;
00066   for (pos = m_map.begin(); pos != m_map.end(); ++pos) {
00067     cout << pos->first << endl;
00068   }
00069 }

template<class T>
bool HltStoreSvc::put const std::string &  name,
const T &  value
[inline]
 

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   }

template<class T>
bool HltStoreSvc::put const std::string &  name,
const T &  value
[inline]
 

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   }

virtual StatusCode HltStoreSvc::queryInterface const InterfaceID &  riid,
void **  ppvIF
[virtual]
 

StatusCode HltStoreSvc::queryInterface const InterfaceID &  riid,
void **  ppvIF
[virtual]
 

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 }

int HltStoreSvc::size  ) 
 

int HltStoreSvc::size  ) 
 

00071                      {
00072   return m_map.size();
00073 }

string HltStoreSvc::sListLength  ) 
 

string HltStoreSvc::sListLength  ) 
 

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 }


Member Data Documentation

HltStoreSvc* HltStoreSvc::m_HltStore [private]
 

HltStoreSvc* HltStoreSvc::m_HltStore [private]
 

ContainerType HltStoreSvc::m_map [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:17:43 2011 for BOSS6.5.5 by  doxygen 1.3.9.1