00001 #ifndef FWCore_ParameterSet_ParameterSetDescription_h 00002 #define FWCore_ParameterSet_ParameterSetDescription_h 00003 // -*- C++ -*- 00004 // 00005 // Package: ParameterSet 00006 // Class : ParameterSetDescription 00007 // 00016 // 00017 // Original Author: Chris Jones 00018 // Created: Tue Jul 31 15:18:40 EDT 2007 00019 // $Id: ParameterSetDescription.h,v 1.1 2007/09/17 21:04:37 chrjones Exp $ 00020 // 00021 00022 // system include files 00023 #include <vector> 00024 #include <boost/shared_ptr.hpp> 00025 00026 // user include files 00027 00028 // forward declarations 00029 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h" 00030 #include "FWCore/ParameterSet/interface/ParameterDescriptionTemplate.h" 00031 00032 namespace edm { 00033 class ParameterSetDescription 00034 { 00035 00036 public: 00037 typedef std::vector<boost::shared_ptr<ParameterDescription> > Parameters; 00038 typedef Parameters::const_iterator parameter_const_iterator; 00039 00040 ParameterSetDescription(); 00041 virtual ~ParameterSetDescription(); 00042 00044 void setAllowAnything(); 00045 00049 void setUnknown(); 00050 00051 template<class T> 00052 void add(const std::string& iLabel) { 00053 parameters_.push_back( boost::shared_ptr<ParameterDescription>(new ParameterDescriptionTemplate<T>(iLabel,true) ) ); 00054 } 00055 00056 template<class T> 00057 void addUntracked(const std::string& iLabel) { 00058 parameters_.push_back( new ParameterDescriptionTemplate<T>(iLabel,false) ); 00059 } 00060 // ---------- const member functions --------------------- 00061 //Throws a cms::Exception if invalid 00062 void validate(const edm::ParameterSet& ) const; 00063 00064 00065 bool anythingAllowed() const { 00066 return anythingAllowed_; 00067 } 00068 00069 bool isUnknown() const { 00070 return unknown_; 00071 } 00072 00073 parameter_const_iterator parameter_begin() const { 00074 return parameters_.begin(); 00075 } 00076 parameter_const_iterator parameter_end() const { 00077 return parameters_.end(); 00078 } 00079 // ---------- static member functions -------------------- 00080 00081 // ---------- member functions --------------------------- 00082 00083 private: 00084 //ParameterSetDescription(const ParameterSetDescription&); // stop default 00085 00086 //const ParameterSetDescription& operator=(const ParameterSetDescription&); // stop default 00087 00088 // ---------- member data -------------------------------- 00089 bool anythingAllowed_; 00090 bool unknown_; 00091 Parameters parameters_; 00092 }; 00093 00094 } 00095 #endif