CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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 
00038     ParameterSetID id() const {return theID_;}
00039   
00042     ParameterSet const& pset() const;
00043     ParameterSet& pset();
00044 
00045     void updateID() const;
00046 
00047     friend std::ostream & operator<<(std::ostream & os, ParameterSetEntry const& psetEntry);
00048 
00049   private:
00050     
00051     bool isTracked_;
00052     // can be internally reconstituted from the ID, in an
00053     // ostensibly const function
00054     mutable value_ptr<ParameterSet> thePSet_;
00055 
00056     // mutable so save() can serialize it as late as possible
00057     mutable ParameterSetID theID_;
00058   };
00059 
00060 }
00061 
00062 #endif
00063