File indexing completed on 2024-04-06 12:03:50
0001 #ifndef DataFormats_Common_ContainerMaskTraits_h
0002 #define DataFormats_Common_ContainerMaskTraits_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <cstddef>
0023
0024
0025
0026
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;
0040 const ContainerMaskTraits& operator=(const ContainerMaskTraits&) = delete;
0041
0042 private:
0043
0044
0045
0046 };
0047 }
0048
0049 #endif