Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:07

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTCache
0004  *
0005  *   Trigger Cache
0006  *   Used to store various trigger data
0007  *
0008  *
0009  *
0010  *
0011  *   \author  C. Battilana
0012  *
0013  *   Modifications:
0014  */
0015 //
0016 //--------------------------------------------------
0017 #ifndef DT_CACHE_H
0018 #define DT_CACHE_H
0019 
0020 #include <vector>
0021 
0022 template <class T, class Coll = std::vector<T>>
0023 class DTCache {
0024 public:
0025   typedef T my_type;
0026   typedef Coll my_collection;
0027   typedef typename my_collection::iterator iterator;
0028   typedef typename my_collection::const_iterator const_iterator;
0029 
0030 public:
0031   //! Constructor
0032   DTCache() {}
0033 
0034   //! Destructor
0035   virtual ~DTCache() {}
0036 
0037   //! Get first cache element
0038   const_iterator begin() const { return _cache.begin(); }
0039 
0040   //! Get last cache element
0041   const_iterator end() const { return _cache.end(); }
0042 
0043   //! Get cache vector's size
0044   int size() const { return _cache.size(); }
0045 
0046   //! Clear cache vector
0047   void clearCache() { _cache.clear(); }
0048 
0049   //! Virtual reconstruct member
0050   virtual void reconstruct() {}
0051 
0052 protected:
0053   my_collection _cache;
0054 };
0055 #endif