CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondCore/IOVService/interface/KeyListProxy.h

Go to the documentation of this file.
00001 #ifndef CondCore_IOVService_KeyListProxy_h
00002 #define CondCore_IOVService_KeyListProxy_h
00003 
00004 #include "CondCore/IOVService/interface/PayloadProxy.h"
00005 #include "CondCore/IOVService/interface/KeyList.h"
00006 #include <vector>
00007 #include <string>
00008 
00009 namespace cond {
00010 
00011   template<> class PayloadProxy<cond::KeyList> : public PayloadProxy<std::vector<cond::Time_t> > {
00012   public:
00013     typedef std::vector<cond::Time_t> DataT;
00014     typedef PayloadProxy<DataT> super;
00015 
00016     PayloadProxy(cond::DbSession& session,
00017                  const std::string & token, bool errorPolicy, const char * source=0) :
00018       super(session, token, errorPolicy) {
00019       m_name = source;
00020     }
00021     
00022     virtual ~PayloadProxy(){}
00023 
00024     // dereference (does not load)
00025     const cond::KeyList & operator()() const {
00026       return me; 
00027     }
00028         
00029     virtual void invalidateCache() {
00030       super::invalidateCache();
00031     }
00032 
00033     virtual void loadMore(CondGetter const & getter){
00034       me.init(getter.get(m_name));
00035     }
00036 
00037 
00038   protected:
00039     virtual bool load( DbSession& sess, std::string const & token) {
00040       bool ok = super::load(sess, token);
00041       me.load(super::operator()());
00042       return ok;
00043     }
00044 
00045   private:
00046 
00047     std::string m_name;
00048 
00049     KeyList me;
00050 
00051   };
00052 }
00053 #endif