Go to the documentation of this file.00001 #ifndef CondCore_IOVService_KeyList_h
00002 #define CondCore_IOVService_KeyList_h
00003
00004 #include "CondCore/IOVService/interface/IOVProxy.h"
00005 #include "CondFormats/Common/interface/BaseKeyed.h"
00006 #include<vector>
00007 #include<string>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 namespace cond {
00023
00024 class IOVKeysDescription;
00025
00026 class KeyList {
00027 public:
00028 typedef BaseKeyed Base;
00029
00030 KeyList(IOVKeysDescription const * idescr=0);
00031
00032 void init(cond::IOVProxy const & seq ) {
00033 m_sequence = seq;
00034 }
00035
00036 void load(std::vector<unsigned long long> const & keys);
00037
00038 template<typename T>
00039 T const * get(int n) const {
00040 return dynamic_cast<T const *>(elem(n));
00041 }
00042
00043 template<typename T>
00044 T const * get(char const * iname) const {
00045 return dynamic_cast<T const *>(elem(iname));
00046 }
00047
00048 template<typename T>
00049 T const * get(std::string const & iname) const {
00050 return dynamic_cast<T const *>(elem(iname));
00051 }
00052
00053 BaseKeyed const * elem(int n) const;
00054
00055 BaseKeyed const * elem(char const * iname) const;
00056
00057 BaseKeyed const * elem(std::string const & iname) const;
00058
00059 int size() const { return m_data.size();}
00060
00061 private:
00062
00063 IOVKeysDescription const * m_description;
00064
00065
00066 cond::IOVProxy m_sequence;
00067
00068 std::vector<boost::shared_ptr<Base> > m_data;
00069
00070 };
00071
00072
00073 }
00074
00075 #endif