CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/DataFormats/Common/interface/ContainerMaskTraits.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Common_ContainerMaskTraits_h
00002 #define DataFormats_Common_ContainerMaskTraits_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Common
00006 // Class  :     ContainerMaskTraits
00007 // 
00016 //
00017 // Original Author:  
00018 //         Created:  Fri Sep 23 17:05:48 CDT 2011
00019 // $Id: ContainerMaskTraits.h,v 1.1 2011/12/01 13:02:17 vlimant Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 
00026 // forward declarations
00027 namespace edm {
00028    template<typename T>
00029    class ContainerMaskTraits {
00030 
00031    public:
00032       typedef typename T::value_type value_type;
00033 
00034       static size_t size(const T* iContainer) { return iContainer->size();}
00035       static unsigned int indexFor(const value_type* iElement, const T* iContainer) {
00036          return iElement-&(iContainer->front());
00037       }
00038       
00039    private:
00040       //virtual ~ContainerMaskTraits();
00041       ContainerMaskTraits();
00042       ContainerMaskTraits(const ContainerMaskTraits&); // stop default
00043 
00044       const ContainerMaskTraits& operator=(const ContainerMaskTraits&); // stop default
00045 
00046       // ---------- member data --------------------------------
00047 
00048    };
00049 }
00050 
00051 #endif