Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SmartDataLocator.h
Go to the documentation of this file.
1 // ====================================================================
2 // SmartDataLocator.h
3 // --------------------------------------------------------------------
4 //
5 // Package : GaudiKernel ( The LHCb Offline System)
6 //
7 // Description: Implementation of a smart pointer class to access
8 // easily (and efficiently) data stores.
9 //
10 // Author : M.Frank
11 // ====================================================================
12 #ifndef GAUDIKERNEL_SMARTDATALOCATOR_H
13 #define GAUDIKERNEL_SMARTDATALOCATOR_H 1
14 
15 // Framework include files
17 
45 template<class TYPE> class SmartDataLocator : public SmartDataStorePtr<TYPE, SmartDataObjectPtr::ObjectLoader> {
46 public:
55  SmartDataLocator(IDataProviderSvc* pService, const std::string& fullPath)
56  : SmartDataStorePtr<TYPE,SmartDataObjectPtr::ObjectLoader>( pService,0,fullPath)
57  {
58  }
59 
69  : SmartDataStorePtr<TYPE,SmartDataObjectPtr::ObjectLoader>( pService,pDirectory,"")
70  {
71  }
72 
85  : SmartDataStorePtr<TYPE,SmartDataObjectPtr::ObjectLoader>( pService,0,path)
86  {
87  if ( 0 != pObject ) {
88  this->m_pDirectory = pObject->registry();
89  }
90  }
91 
102  : SmartDataStorePtr<TYPE,SmartDataObjectPtr::ObjectLoader>( refObject.service(), pDirectory, "")
103  {
104  }
105 
116  : SmartDataStorePtr<TYPE,SmartDataObjectPtr::ObjectLoader>( refObject.service(), refObject.directory(), path)
117  {
118  }
119 
122  virtual ~SmartDataLocator() {
123  }
124 
126  template <class OTHER>
127  SmartDataPtr<OTHER>& operator=( OTHER* pObj ) {
128  this->m_pObject = dynamic_cast<TYPE*>(pObj);
129  return *this;
130  }
131 
133  template <class OTHER>
134  SmartDataPtr<OTHER>& operator=( const OTHER* pObj ) {
135  this->m_pObject = dynamic_cast<TYPE*>(const_cast<OTHER*>(pObj));
136  return *this;
137  }
138 };
139 
140 #endif // GAUDIKERNEL_SMARTDATALOCATOR_H

Generated at Wed Jan 30 2013 17:13:40 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004