CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Common/interface/PostReadFixupTrait.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Common_PostReadFixupTrait_h
00002 #define DataFormats_Common_PostReadFixupTrait_h
00003 
00004 namespace edm {
00005   namespace helpers {
00006     struct DoNoPostReadFixup {
00007       void touch() { }
00008       template<typename C>
00009       void operator()(const C &) const { }
00010     };
00011     
00012     struct PostReadFixup {
00013       PostReadFixup() : fixed_(false) { }
00014       void touch() { fixed_ = false; }
00015       template<typename C>
00016       void operator()(const C & c) const { 
00017         if (!fixed_) {
00018           fixed_ = true;
00019           for (typename C::const_iterator i = c.begin(), e = c.end(); i != e; ++i)
00020             (*i)->fixup();
00021         }
00022       }
00023     private:
00024       mutable bool fixed_;
00025     };
00026 
00027     template<typename T>
00028     struct PostReadFixupTrait {
00029      typedef DoNoPostReadFixup type;
00030     };
00031   }
00032 }
00033 
00034 #endif