CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/FWCore/ParameterSet/interface/AllowedLabelsDescriptionBase.h

Go to the documentation of this file.
00001 #ifndef FWCore_ParameterSet_AllowedLabelsDescriptionBase_h
00002 #define FWCore_ParameterSet_AllowedLabelsDescriptionBase_h
00003 
00004 #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h"
00005 #include "FWCore/ParameterSet/interface/ParameterDescription.h"
00006 
00007 #include <vector>
00008 #include <string>
00009 #include <set>
00010 #include <iosfwd>
00011 
00012 namespace edm {
00013 
00014   class ParameterSet;
00015 
00016   class AllowedLabelsDescriptionBase : public ParameterDescriptionNode {
00017   public:
00018 
00019     virtual ~AllowedLabelsDescriptionBase();
00020 
00021     ParameterTypes type() const { return type_; }
00022     bool isTracked() const { return isTracked_; }
00023 
00024   protected:
00025 
00026     AllowedLabelsDescriptionBase(std::string const& label, ParameterTypes iType, bool isTracked);
00027 
00028     AllowedLabelsDescriptionBase(char const* label, ParameterTypes iType, bool isTracked);
00029 
00030     void printNestedContentBase_(std::ostream & os,
00031                                  bool optional,
00032                                  DocFormatHelper & dfh);
00033 
00034   private:
00035 
00036     virtual void checkAndGetLabelsAndTypes_(std::set<std::string> & usedLabels,
00037                                             std::set<ParameterTypes> & parameterTypes,
00038                                             std::set<ParameterTypes> & wildcardTypes) const;
00039 
00040     virtual void validate_(ParameterSet & pset,
00041                            std::set<std::string> & validatedLabels,
00042                            bool optional) const;
00043 
00044     virtual void writeCfi_(std::ostream & os,
00045                            bool & startWithComma,
00046                            int indentation,
00047                            bool & wroteSomething) const;
00048 
00049 
00050     virtual void print_(std::ostream & os,
00051                         bool optional,
00052                         bool writeToCfi,
00053                         DocFormatHelper & dfh);
00054 
00055     virtual bool hasNestedContent_();
00056 
00057     virtual void printNestedContent_(std::ostream & os,
00058                                      bool optional,
00059                                      DocFormatHelper & dfh);
00060 
00061     virtual bool exists_(ParameterSet const& pset) const;
00062 
00063     virtual bool partiallyExists_(ParameterSet const& pset) const;
00064 
00065     virtual int howManyXORSubNodesExist_(ParameterSet const& pset) const;
00066 
00067     virtual void validateAllowedLabel_(std::string const& allowedLabel,
00068                                        ParameterSet & pset,
00069                                        std::set<std::string> & validatedLabels) const = 0;
00070 
00071     ParameterDescription<std::vector<std::string> > parameterHoldingLabels_;
00072     ParameterTypes type_;
00073     bool isTracked_;
00074   };
00075 }
00076 
00077 #endif