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

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
 
ParameterSetpset ()
 
void setIsTracked (bool v)
 
void toDigest (cms::Digest &digest) const
 
std::string toString () const
 
void toString (std::string &result) const
 
void updateID () const
 
 ~ParameterSetEntry ()
 

Private Attributes

bool isTracked_
 
ParameterSetID theID_
 
value_ptr< ParameterSetthePSet_
 

Friends

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

Detailed Description

Definition at line 21 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  }
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
value_ptr< ParameterSet > thePSet_
ParameterSet const & pset() const
bool isRegistered() const
Definition: ParameterSet.h:66
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSetID const &  id,
bool  isTracked 
)

Definition at line 28 of file ParameterSetEntry.cc.

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

Definition at line 35 of file ParameterSetEntry.cc.

References 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  }
value_ptr< ParameterSet > thePSet_
void swap(Hash< I > &other)
Definition: Hash.h:202
Hash< ParameterSetType > ParameterSetID
edm::ParameterSetEntry::~ParameterSetEntry ( )

Definition at line 47 of file ParameterSetEntry.cc.

47 {}

Member Function Documentation

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, reconstituting it from the Registry, if necessary

Definition at line 82 of file ParameterSetEntry.cc.

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

Referenced by edm::ParameterSet::getParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), FWPSetTableManager::handlePSetEntry(), edm::operator<<(), prettyPrint(), and updateID().

82  {
83  if(!thePSet_) {
84  // get it from the registry, and save it here
85  thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
86  }
87  return *thePSet_;
88  }
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< ParameterSet > thePSet_
ParameterSet & edm::ParameterSetEntry::pset ( )

Definition at line 90 of file ParameterSetEntry.cc.

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

90  {
91  if(!thePSet_) {
92  // get it from the registry, and save it here
93  thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
94  }
95  return *thePSet_;
96  }
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< ParameterSet > thePSet_
void edm::ParameterSetEntry::setIsTracked ( bool  v)
inline

Definition at line 37 of file ParameterSetEntry.h.

References isTracked_, and v.

37 { isTracked_ = v; }
mathSSE::Vec4< T > v
void edm::ParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 63 of file ParameterSetEntry.cc.

References cms::Digest::append(), edm::hlt::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:195
bool isValid() const
Definition: Hash.h:146
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 query::result.

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

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

Definition at line 50 of file ParameterSetEntry.cc.

References edm::hlt::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: query.py:137
void toString(std::string &result) const
Definition: Hash.h:188
bool isValid() const
Definition: Hash.h:146
void edm::ParameterSetEntry::updateID ( ) const

Definition at line 98 of file ParameterSetEntry.cc.

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

98  {
99  assert(pset().isRegistered());
100  theID_ = pset().id();
101  }
ParameterSetID id() const
ParameterSet const & pset() const

Friends And Related Function Documentation

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

Definition at line 103 of file ParameterSetEntry.cc.

103  {
104  const char* trackiness = (psetEntry.isTracked()?"tracked":"untracked");
105  os << "PSet "<<trackiness<<" = ("<< psetEntry.pset() << ")";
106  return os;
107  }

Member Data Documentation

bool edm::ParameterSetEntry::isTracked_
private

Definition at line 52 of file ParameterSetEntry.h.

Referenced by isTracked(), and setIsTracked().

ParameterSetID edm::ParameterSetEntry::theID_
mutableprivate

Definition at line 58 of file ParameterSetEntry.h.

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

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

Definition at line 55 of file ParameterSetEntry.h.

Referenced by pset().