CMS 3D CMS Logo

MethodArgumentSetter.h

Go to the documentation of this file.
00001 #ifndef Utilities_MethodArgumentSetter_h
00002 #define Utilities_MethodArgumentSetter_h
00003 /* \class reco::parser::MethodArgumentSetter
00004  *
00005  * MethodArgumenteger setter
00006  *
00007  * \author  Luca Lista, INFN
00008  *
00009  * \version $Revision: 1.1 $
00010  *
00011  */
00012 #include "PhysicsTools/Utilities/src/MethodArgumentStack.h"
00013 #include <cassert>
00014 
00015 namespace reco {
00016   namespace parser {
00017     struct MethodArgumentSetter {
00018       MethodArgumentSetter( MethodArgumentStack & stack ) : stack_( stack ) { }
00019       template<typename T>
00020       void operator()(const T &n) const {
00021         stack_.push_back( AnyMethodArgument(n) );
00022       }
00023       void operator()(const char *begin, const char *end) const {
00024         assert(begin+1 <= end-1); // the quotes are included in [begin,end[ range.        
00025         stack_.push_back( AnyMethodArgument(std::string(begin+1,end-1)) );
00026       }
00027     private:
00028       MethodArgumentStack & stack_;
00029     };
00030   }
00031 }
00032 
00033 #endif

Generated on Tue Jun 9 17:42:52 2009 for CMSSW by  doxygen 1.5.4