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 ()
 
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 18 of file ParameterSetEntry.h.

Constructor & Destructor Documentation

edm::ParameterSetEntry::ParameterSetEntry ( )

Definition at line 9 of file ParameterSetEntry.cc.

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

Definition at line 16 of file ParameterSetEntry.cc.

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

19  theID_()
20  {
21  if (pset.isRegistered()) {
22  theID_ = pset.id();
23  }
24  }
ParameterSetID id() const
value_ptr< ParameterSet > thePSet_
ParameterSet const & pset() const
bool isRegistered() const
Definition: ParameterSet.h:60
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSetID const &  id,
bool  isTracked 
)

Definition at line 26 of file ParameterSetEntry.cc.

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

Definition at line 33 of file ParameterSetEntry.cc.

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

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

Definition at line 45 of file ParameterSetEntry.cc.

45 {}

Member Function Documentation

ParameterSetID edm::ParameterSetEntry::id ( void  ) const
inline

Definition at line 34 of file ParameterSetEntry.h.

References theID_.

34 {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 67 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().

67  {
68  if(!thePSet_) {
69  // get it from the registry, and save it here
70  thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
71  }
72  return *thePSet_;
73  }
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< ParameterSet > thePSet_
ParameterSet & edm::ParameterSetEntry::pset ( )

Definition at line 75 of file ParameterSetEntry.cc.

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

75  {
76  if(!thePSet_) {
77  // get it from the registry, and save it here
78  thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
79  }
80  return *thePSet_;
81  }
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< ParameterSet > thePSet_
std::string edm::ParameterSetEntry::toString ( ) const

Definition at line 61 of file ParameterSetEntry.cc.

References query::result.

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

61  {
62  std::string result;
63  toString(result);
64  return result;
65  }
tuple result
Definition: query.py:137
std::string toString() const
void edm::ParameterSetEntry::toString ( std::string &  result) const

Definition at line 48 of file ParameterSetEntry.cc.

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

48  {
49  result += isTracked() ? "+Q(" : "-Q(";
50  if (!theID_.isValid()) {
52  << "ParameterSet::toString() called prematurely\n"
53  << "before ParameterSet::registerIt() has been called\n"
54  << "for all nested parameter sets\n";
55  }
57  result += ')';
58  }
tuple result
Definition: query.py:137
void toString(std::string &result) const
Definition: Hash.h:178
bool isValid() const
Definition: Hash.h:136
void edm::ParameterSetEntry::updateID ( ) const

Definition at line 83 of file ParameterSetEntry.cc.

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

83  {
84  assert(pset().isRegistered());
85  theID_ = pset().id();
86  }
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 88 of file ParameterSetEntry.cc.

88  {
89  const char* trackiness = (psetEntry.isTracked()?"tracked":"untracked");
90  os << "PSet "<<trackiness<<" = ("<< psetEntry.pset() << ")";
91  return os;
92  }

Member Data Documentation

bool edm::ParameterSetEntry::isTracked_
private

Definition at line 47 of file ParameterSetEntry.h.

Referenced by isTracked().

ParameterSetID edm::ParameterSetEntry::theID_
mutableprivate

Definition at line 53 of file ParameterSetEntry.h.

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

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

Definition at line 50 of file ParameterSetEntry.h.

Referenced by pset().