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::VParameterSetEntry Class Reference

#include <VParameterSetEntry.h>

Public Member Functions

std::string dump (unsigned int indent=0) const
 
bool isTracked () const
 
ParameterSetpsetInVector (int i)
 
void registerPsetsAndUpdateIDs ()
 
std::vector< ParameterSet >
::size_type 
size () const
 
void toDigest (cms::Digest &digest) const
 
std::string toString () const
 
void toString (std::string &result) const
 
 VParameterSetEntry ()
 
 VParameterSetEntry (std::vector< ParameterSet > const &vpset, bool isTracked)
 
 VParameterSetEntry (std::string const &rep)
 
std::vector< ParameterSet > const & vpset () const
 
std::vector< ParameterSet > & vpset ()
 
 ~VParameterSetEntry ()
 

Private Attributes

value_ptr< std::vector
< ParameterSetID > > 
theIDs
 
value_ptr< std::vector
< ParameterSet > > 
theVPSet
 
bool tracked
 

Friends

std::ostream & operator<< (std::ostream &os, VParameterSetEntry const &vpsetEntry)
 

Detailed Description

Definition at line 22 of file VParameterSetEntry.h.

Constructor & Destructor Documentation

edm::VParameterSetEntry::VParameterSetEntry ( )

Definition at line 12 of file VParameterSetEntry.cc.

12  :
13  tracked(false),
14  theVPSet(),
15  theIDs() {
16  }
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet
edm::VParameterSetEntry::VParameterSetEntry ( std::vector< ParameterSet > const &  vpset,
bool  isTracked 
)

Definition at line 18 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, and theVPSet.

18  :
20  theVPSet(new std::vector<ParameterSet>),
21  theIDs() {
22  for (std::vector<ParameterSet>::const_iterator i = vpset.begin(), e = vpset.end(); i != e; ++i) {
23  theVPSet->push_back(*i);
24  }
25  }
int i
Definition: DBlmapReader.cc:9
std::vector< ParameterSet > const & vpset() const
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet
edm::VParameterSetEntry::VParameterSetEntry ( std::string const &  rep)

Definition at line 27 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, edm::split(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and theIDs.

27  :
28  tracked(rep[0] == '+'),
29  theVPSet(),
30  theIDs(new std::vector<ParameterSetID>) {
31  assert(rep[0] == '+' || rep[0] == '-');
32  std::vector<std::string> temp;
33  // need a substring that starts at the '{'
34  std::string bracketedRepr(rep.begin()+2, rep.end());
35  split(std::back_inserter(temp), bracketedRepr, '{', ',', '}');
36  theIDs->reserve(temp.size());
37  for (std::vector<std::string>::const_iterator i = temp.begin(), e = temp.end(); i != e; ++i) {
38  theIDs->push_back(ParameterSetID(*i));
39  }
40  }
int i
Definition: DBlmapReader.cc:9
string rep
Definition: cuy.py:1188
bool split(OutIter result, std::string const &string_to_split, char first, char sep, char last)
Definition: split.h:88
Hash< ParameterSetType > ParameterSetID
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet
edm::VParameterSetEntry::~VParameterSetEntry ( )

Definition at line 42 of file VParameterSetEntry.cc.

42 {}

Member Function Documentation

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

Definition at line 120 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, isTracked(), dqm_diff::start, AlCaHLTBitMon_QueryRunRegistry::string, and vpset().

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

120  {
121  std::string indentation(indent, ' ');
122  std::ostringstream os;
123  std::vector<ParameterSet> const& vps = vpset();
124  os << "VPSet "<<(isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
126  std::string const between(",\n");
127  for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
128  os << start << indentation << i->dump(indent);
129  start = between;
130  }
131  if (!vps.empty()) {
132  os << std::endl;
133  }
134  os << indentation << "})";
135  return os.str();
136  }
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
std::vector< ParameterSet > const & vpset() const
bool edm::VParameterSetEntry::isTracked ( ) const
inline
ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)
void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 108 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, theIDs, theVPSet, and vpset().

108  {
109  vpset();
110  theIDs = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
111  theIDs->resize(theVPSet->size());
112  for (std::vector<ParameterSet>::iterator i = theVPSet->begin(), e = theVPSet->end(); i != e; ++i) {
113  if (!i->isRegistered()) {
114  i->registerIt();
115  }
116  theIDs->at(i - theVPSet->begin()) = i->id();
117  }
118  }
int i
Definition: DBlmapReader.cc:9
std::vector< ParameterSet > const & vpset() const
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet
std::vector<ParameterSet>::size_type edm::VParameterSetEntry::size ( void  ) const
inline
void edm::VParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 60 of file VParameterSetEntry.cc.

References cms::Digest::append(), alignCSCRings::e, i, theIDs, and tracked.

60  {
61  assert(theIDs);
62  digest.append(tracked ? "+q{" : "-q{", 3);
63  bool started = false;
64  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
65  if (started)
66  digest.append(",", 1);
67  i->toDigest(digest);
68  started = true;
69  }
70  digest.append("}",1);
71  }
int i
Definition: DBlmapReader.cc:9
value_ptr< std::vector< ParameterSetID > > theIDs
void append(std::string const &s)
Definition: Digest.cc:182
std::string edm::VParameterSetEntry::toString ( ) const

Definition at line 73 of file VParameterSetEntry.cc.

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

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

73  {
75  toString(result);
76  return result;
77  }
tuple result
Definition: query.py:137
std::string toString() const
void edm::VParameterSetEntry::toString ( std::string &  result) const

Definition at line 45 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, dqm_diff::start, AlCaHLTBitMon_QueryRunRegistry::string, theIDs, and tracked.

45  {
46  assert(theIDs);
47  result += tracked ? "+q" : "-q";
48  result += '{';
50  std::string const between(",");
51  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
52  result += start;
53  i->toString(result);
54  start = between;
55  }
56  result += '}';
57  }
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
tuple result
Definition: query.py:137
value_ptr< std::vector< ParameterSetID > > theIDs
std::vector< ParameterSet > const & edm::VParameterSetEntry::vpset ( ) const

returns the VPSet, reconstituting it from the Registry, if necessary

Definition at line 79 of file VParameterSetEntry.cc.

References alignCSCRings::e, edm::getParameterSet(), i, theIDs, and theVPSet.

Referenced by dump(), edm::ParameterSet::getParameterSetVector(), edm::ParameterSet::getUntrackedParameterSetVector(), FWPSetTableManager::handleVPSetEntry(), prettyPrint(), registerPsetsAndUpdateIDs(), and size().

79  {
80  if (!theVPSet) {
81  assert(theIDs);
82  theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
83  theVPSet->reserve(theIDs->size());
84  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
85  theVPSet->push_back(getParameterSet(*i));
86  }
87  }
88  return *theVPSet;
89  }
int i
Definition: DBlmapReader.cc:9
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet
std::vector< ParameterSet > & edm::VParameterSetEntry::vpset ( )

Definition at line 91 of file VParameterSetEntry.cc.

References alignCSCRings::e, edm::getParameterSet(), i, theIDs, and theVPSet.

91  {
92  if (!theVPSet) {
93  assert(theIDs);
94  theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
95  theVPSet->reserve(theIDs->size());
96  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
97  theVPSet->push_back(getParameterSet(*i));
98  }
99  }
100  return *theVPSet;
101  }
int i
Definition: DBlmapReader.cc:9
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< std::vector< ParameterSetID > > theIDs
value_ptr< std::vector< ParameterSet > > theVPSet

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
VParameterSetEntry const &  vpsetEntry 
)
friend

Definition at line 138 of file VParameterSetEntry.cc.

138  {
139  os << vpsetEntry.dump();
140  return os;
141  }

Member Data Documentation

value_ptr<std::vector<ParameterSetID> > edm::VParameterSetEntry::theIDs
mutableprivate
value_ptr<std::vector<ParameterSet> > edm::VParameterSetEntry::theVPSet
mutableprivate
bool edm::VParameterSetEntry::tracked
private

Definition at line 52 of file VParameterSetEntry.h.

Referenced by isTracked(), toDigest(), and toString().