CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/CommonTools/Utils/src/CutSetter.h

Go to the documentation of this file.
00001 #ifndef CommonTools_Utils_CutSetter_h
00002 #define CommonTools_Utils_CutSetter_h
00003 /* \class reco::parser::CutSetter
00004  *
00005  * Cut setter
00006  *
00007  * \author original version: Chris Jones, Cornell, 
00008  *         adapted to Reflex by Luca Lista, INFN
00009  *
00010  * \version $Revision: 1.1 $
00011  *
00012  */
00013 #include "CommonTools/Utils/src/SelectorPtr.h"
00014 #include "CommonTools/Utils/src/SelectorStack.h"
00015 
00016 namespace reco {
00017   namespace parser {    
00018     struct CutSetter {
00019       CutSetter(SelectorPtr & cut, SelectorStack & selStack) :
00020         cut_(cut), selStack_(selStack) { }
00021       
00022       void operator()(const char*, const char*) const {
00023         assert(0 == cut_.get());
00024         assert(!selStack_.empty());
00025         cut_ = selStack_.back();
00026         selStack_.pop_back();
00027       }
00028       SelectorPtr & cut_;
00029       SelectorStack & selStack_;
00030     };
00031   }
00032  }
00033 
00034 #endif