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 friend std::ostream & operator<<(std::ostream & os, ParameterSetEntry const& psetEntry); 00049 00050 private: 00051 00052 bool isTracked_; 00053 // can be internally reconstituted from the ID, in an 00054 // ostensibly const function 00055 mutable value_ptr<ParameterSet> thePSet_; 00056 00057 // mutable so save() can serialize it as late as possible 00058 mutable ParameterSetID theID_; 00059 }; 00060 00061 } 00062 00063 #endif 00064