CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/FWCore/ParameterSet/interface/ParameterSetEntry.h

Go to the documentation of this file.
00001 #ifndef ParameterSet_ParameterSetEntry_h
00002 #define ParameterSet_ParameterSetEntry_h
00003 
00010 #include "FWCore/Utilities/interface/value_ptr.h"
00011 #include "DataFormats/Provenance/interface/ParameterSetID.h"
00012 namespace cms {
00013   class Digest;
00014 }
00015 
00016 namespace edm {
00017 
00018   // forward declaration
00019   class ParameterSet;
00020 
00021   class ParameterSetEntry
00022   {
00023   public:
00024     // default ctor for serialization
00025     ParameterSetEntry();
00026     ParameterSetEntry(ParameterSet const& pset, bool isTracked);
00027     ParameterSetEntry(ParameterSetID const& id, bool isTracked);
00028     explicit ParameterSetEntry(std::string const& rep);
00029 
00030     ~ParameterSetEntry();
00031 
00032     std::string toString() const;
00033     void toString(std::string& result) const;
00034     void toDigest(cms::Digest &digest) const;
00035 
00036     bool isTracked() const {return isTracked_;}
00037     void setIsTracked(bool v) { isTracked_ = v; }
00038 
00039     ParameterSetID id() const {return theID_;}
00040   
00043     ParameterSet const& pset() const;
00044     ParameterSet& pset();
00045 
00046     void updateID() const;
00047 
00048     std::string dump(unsigned int indent = 0) const;
00049     friend std::ostream & operator<<(std::ostream & os, ParameterSetEntry const& psetEntry);
00050 
00051   private:
00052     
00053     bool isTracked_;
00054     // can be internally reconstituted from the ID, in an
00055     // ostensibly const function
00056     mutable value_ptr<ParameterSet> thePSet_;
00057 
00058     // mutable so save() can serialize it as late as possible
00059     mutable ParameterSetID theID_;
00060   };
00061 
00062 }
00063 
00064 #endif
00065