File indexing completed on 2024-04-06 12:12:52
0001 #ifndef ParameterSet_ParameterSetEntry_h
0002 #define ParameterSet_ParameterSetEntry_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "FWCore/Utilities/interface/atomic_value_ptr.h"
0011 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0012 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0013
0014 namespace cms {
0015 class Digest;
0016 }
0017
0018 namespace edm {
0019
0020
0021 class ParameterSet;
0022
0023 class ParameterSetEntry {
0024 public:
0025
0026 ParameterSetEntry();
0027 ParameterSetEntry(ParameterSet const& pset, bool isTracked);
0028 ParameterSetEntry(ParameterSetID const& id, bool isTracked);
0029 explicit ParameterSetEntry(std::string_view rep);
0030
0031 ~ParameterSetEntry() = default;
0032 ParameterSetEntry(ParameterSetEntry const&) = default;
0033 ParameterSetEntry(ParameterSetEntry&&) = default;
0034 ParameterSetEntry& operator=(ParameterSetEntry const&) = default;
0035 ParameterSetEntry& operator=(ParameterSetEntry&&) = default;
0036
0037 std::string toString() const;
0038 void toString(std::string& result) const;
0039 void toDigest(cms::Digest& digest) const;
0040
0041 bool isTracked() const { return isTracked_; }
0042 void setIsTracked(bool v) { isTracked_ = v; }
0043
0044 ParameterSetID id() const { return theID_; }
0045
0046
0047 ParameterSet const& pset() const;
0048 ParameterSet& psetForUpdate();
0049
0050 void fillPSet() const;
0051
0052 void updateID();
0053
0054 std::string dump(unsigned int indent = 0) const;
0055 friend std::ostream& operator<<(std::ostream& os, ParameterSetEntry const& psetEntry);
0056
0057 private:
0058 bool isTracked_;
0059
0060
0061 CMS_THREAD_SAFE mutable atomic_value_ptr<ParameterSet> thePSet_;
0062
0063 ParameterSetID theID_;
0064 };
0065
0066 }
0067
0068 #endif