Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:50

0001 #ifndef DataFormats_Common_ContainerMaskTraits_h
0002 #define DataFormats_Common_ContainerMaskTraits_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Common
0006 // Class  :     ContainerMaskTraits
0007 //
0008 /**\class ContainerMaskTraits ContainerMaskTraits.h DataFormats/Common/interface/ContainerMaskTraits.h
0009 
0010  Description: Helper class for ContainerMask which allows for adapting for different container types
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:
0018 //         Created:  Fri Sep 23 17:05:48 CDT 2011
0019 //
0020 
0021 // system include files
0022 #include <cstddef>
0023 
0024 // user include files
0025 
0026 // forward declarations
0027 namespace edm {
0028   template <typename T>
0029   class ContainerMaskTraits {
0030   public:
0031     typedef typename T::value_type value_type;
0032 
0033     static size_t size(const T* iContainer) { return iContainer->size(); }
0034     static unsigned int indexFor(const value_type* iElement, const T* iContainer) {
0035       return iElement - &(iContainer->front());
0036     }
0037 
0038     ContainerMaskTraits() = delete;
0039     ContainerMaskTraits(const ContainerMaskTraits&) = delete;                   // stop default
0040     const ContainerMaskTraits& operator=(const ContainerMaskTraits&) = delete;  // stop default
0041 
0042   private:
0043     //virtual ~ContainerMaskTraits();
0044 
0045     // ---------- member data --------------------------------
0046   };
0047 }  // namespace edm
0048 
0049 #endif