CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
edm::ParameterSetEntry Class Reference

#include <ParameterSetEntry.h>

Public Member Functions

std::string dump (unsigned int indent=0) const
 
void fillPSet () const
 reconstitutes the PSet from the registry More...
 
ParameterSetID id () const
 
bool isTracked () const
 
 ParameterSetEntry ()
 
 ParameterSetEntry (ParameterSet const &pset, bool isTracked)
 
 ParameterSetEntry (ParameterSetID const &id, bool isTracked)
 
 ParameterSetEntry (std::string const &rep)
 
ParameterSet const & pset () const
 returns the PSet More...
 
ParameterSetpsetForUpdate ()
 
void setIsTracked (bool v)
 
void toDigest (cms::Digest &digest) const
 
std::string toString () const
 
void toString (std::string &result) const
 
void updateID ()
 
 ~ParameterSetEntry ()
 

Private Attributes

bool isTracked_
 
ParameterSetID theID_
 
atomic_value_ptr< ParameterSetthePSet_
 

Friends

std::ostream & operator<< (std::ostream &os, ParameterSetEntry const &psetEntry)
 

Detailed Description

Definition at line 22 of file ParameterSetEntry.h.

Constructor & Destructor Documentation

edm::ParameterSetEntry::ParameterSetEntry ( )

Definition at line 11 of file ParameterSetEntry.cc.

12  : isTracked_(false),
13  thePSet_(0),
14  theID_()
15  {
16  }
atomic_value_ptr< ParameterSet > thePSet_
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSet const &  pset,
bool  isTracked 
)

Definition at line 18 of file ParameterSetEntry.cc.

References edm::ParameterSet::id(), edm::ParameterSet::isRegistered(), and theID_.

21  theID_()
22  {
23  if (pset.isRegistered()) {
24  theID_ = pset.id();
25  }
26  }
ParameterSetID id() const
ParameterSet const & pset() const
returns the PSet
bool isRegistered() const
Definition: ParameterSet.h:65
atomic_value_ptr< ParameterSet > thePSet_
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSetID const &  id,
bool  isTracked 
)

Definition at line 28 of file ParameterSetEntry.cc.

30  thePSet_(),
31  theID_(id)
32  {
33  }
atomic_value_ptr< ParameterSet > thePSet_
edm::ParameterSetEntry::ParameterSetEntry ( std::string const &  rep)
explicit

Definition at line 35 of file ParameterSetEntry.cc.

References assert(), AlCaHLTBitMon_QueryRunRegistry::string, edm::Hash< I >::swap(), and theID_.

36  : isTracked_(rep[0] == '+'),
37  thePSet_(),
38  theID_()
39  {
40  assert(rep[0] == '+' || rep[0] == '-');
41  assert(rep[2] == '(');
42  assert(rep[rep.size()-1] == ')');
43  ParameterSetID newID(std::string(rep.begin()+3, rep.end()-1) );
44  theID_.swap(newID);
45  }
string rep
Definition: cuy.py:1188
assert(m_qm.get())
void swap(Hash< I > &other)
Definition: Hash.h:206
Hash< ParameterSetType > ParameterSetID
atomic_value_ptr< ParameterSet > thePSet_
edm::ParameterSetEntry::~ParameterSetEntry ( )

Definition at line 47 of file ParameterSetEntry.cc.

47 {}

Member Function Documentation

std::string edm::ParameterSetEntry::dump ( unsigned int  indent = 0) const

Definition at line 108 of file ParameterSetEntry.cc.

References edm::ParameterSet::dump(), isTracked(), and pset().

Referenced by edm::ParameterSet::dump(), and edm::operator<<().

108  {
109  std::ostringstream os;
110  const char* trackiness = (isTracked()?"tracked":"untracked");
111  os << "PSet "<<trackiness<<" = (" << pset().dump(indent) << ")";
112  return os.str();
113  }
std::string dump(unsigned int indent=0) const
ParameterSet const & pset() const
returns the PSet
void edm::ParameterSetEntry::fillPSet ( ) const

reconstitutes the PSet from the registry

Definition at line 92 of file ParameterSetEntry.cc.

References edm::getParameterSet(), theID_, thePSet_, and tmp.

Referenced by pset(), and psetForUpdate().

92  {
93  if(nullptr == thePSet_.load()) {
94  std::unique_ptr<ParameterSet> tmp(new ParameterSet(getParameterSet(theID_)));
95  ParameterSet* expected = nullptr;
96  if(thePSet_.compare_exchange_strong(expected, tmp.get())) {
97  // thePSet_ was equal to nullptr and now is equal to tmp.get()
98  tmp.release();
99  }
100  }
101  }
ParameterSet const & getParameterSet(ParameterSetID const &id)
atomic_value_ptr< ParameterSet > thePSet_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
ParameterSetID edm::ParameterSetEntry::id ( void  ) const
inline

Definition at line 39 of file ParameterSetEntry.h.

References theID_.

39 {return theID_;}
bool edm::ParameterSetEntry::isTracked ( ) const
inline
ParameterSet const & edm::ParameterSetEntry::pset ( ) const

returns the PSet

Definition at line 82 of file ParameterSetEntry.cc.

References fillPSet(), and thePSet_.

Referenced by dump(), edm::ParameterSet::getParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), prettyPrint(), and updateID().

82  {
83  fillPSet();
84  return *thePSet_;
85  }
void fillPSet() const
reconstitutes the PSet from the registry
atomic_value_ptr< ParameterSet > thePSet_
ParameterSet & edm::ParameterSetEntry::psetForUpdate ( )

Definition at line 87 of file ParameterSetEntry.cc.

References fillPSet(), and thePSet_.

Referenced by FWPSetTableManager::handlePSetEntry().

87  {
88  fillPSet();
89  return *thePSet_;
90  }
void fillPSet() const
reconstitutes the PSet from the registry
atomic_value_ptr< ParameterSet > thePSet_
void edm::ParameterSetEntry::setIsTracked ( bool  v)
inline
void edm::ParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 63 of file ParameterSetEntry.cc.

References cms::Digest::append(), Exception, isTracked(), edm::Hash< I >::isValid(), edm::errors::LogicError, theID_, and edm::Hash< I >::toDigest().

63  {
64  digest.append(isTracked() ? "+Q(" : "-Q(", 3);
65  if (!theID_.isValid()) {
67  << "ParameterSet::toString() called prematurely\n"
68  << "before ParameterSet::registerIt() has been called\n"
69  << "for all nested parameter sets\n";
70  }
71  theID_.toDigest(digest);
72  digest.append(")", 1);
73  }
void toDigest(cms::Digest &digest) const
Definition: Hash.h:199
bool isValid() const
Definition: Hash.h:150
void append(std::string const &s)
Definition: Digest.cc:182
std::string edm::ParameterSetEntry::toString ( ) const

Definition at line 76 of file ParameterSetEntry.cc.

References mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::ParameterSet::getParameterAsString().

76  {
78  toString(result);
79  return result;
80  }
tuple result
Definition: mps_fire.py:84
std::string toString() const
void edm::ParameterSetEntry::toString ( std::string &  result) const

Definition at line 50 of file ParameterSetEntry.cc.

References Exception, isTracked(), edm::Hash< I >::isValid(), edm::errors::LogicError, theID_, and edm::Hash< I >::toString().

50  {
51  result += isTracked() ? "+Q(" : "-Q(";
52  if (!theID_.isValid()) {
54  << "ParameterSet::toString() called prematurely\n"
55  << "before ParameterSet::registerIt() has been called\n"
56  << "for all nested parameter sets\n";
57  }
59  result += ')';
60  }
tuple result
Definition: mps_fire.py:84
void toString(std::string &result) const
Definition: Hash.h:192
bool isValid() const
Definition: Hash.h:150
void edm::ParameterSetEntry::updateID ( )

Definition at line 103 of file ParameterSetEntry.cc.

References assert(), edm::ParameterSet::id(), pset(), and theID_.

103  {
104  assert(pset().isRegistered());
105  theID_ = pset().id();
106  }
ParameterSetID id() const
assert(m_qm.get())
ParameterSet const & pset() const
returns the PSet

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
ParameterSetEntry const &  psetEntry 
)
friend

Definition at line 115 of file ParameterSetEntry.cc.

115  {
116  os << psetEntry.dump();
117  return os;
118  }

Member Data Documentation

bool edm::ParameterSetEntry::isTracked_
private

Definition at line 54 of file ParameterSetEntry.h.

Referenced by isTracked(), and setIsTracked().

ParameterSetID edm::ParameterSetEntry::theID_
private

Definition at line 59 of file ParameterSetEntry.h.

Referenced by fillPSet(), id(), ParameterSetEntry(), toDigest(), toString(), and updateID().

atomic_value_ptr<ParameterSet> edm::ParameterSetEntry::thePSet_
mutableprivate

Definition at line 57 of file ParameterSetEntry.h.

Referenced by fillPSet(), pset(), and psetForUpdate().