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

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 11 of file VParameterSetEntry.cc.

11  :
12  tracked(false),
13  theVPSet(),
14  theIDs() {
15  }
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 17 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, and theVPSet.

17  :
19  theVPSet(new std::vector<ParameterSet>),
20  theIDs() {
21  for (std::vector<ParameterSet>::const_iterator i = vpset.begin(), e = vpset.end(); i != e; ++i) {
22  theVPSet->push_back(*i);
23  }
24  }
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 26 of file VParameterSetEntry.cc.

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

26  :
27  tracked(rep[0] == '+'),
28  theVPSet(),
29  theIDs(new std::vector<ParameterSetID>) {
30  assert(rep[0] == '+' || rep[0] == '-');
31  std::vector<std::string> temp;
32  // need a substring that starts at the '{'
33  std::string bracketedRepr(rep.begin()+2, rep.end());
34  split(std::back_inserter(temp), bracketedRepr, '{', ',', '}');
35  theIDs->reserve(temp.size());
36  for (std::vector<std::string>::const_iterator i = temp.begin(), e = temp.end(); i != e; ++i) {
37  theIDs->push_back(ParameterSetID(*i));
38  }
39  }
int i
Definition: DBlmapReader.cc:9
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 41 of file VParameterSetEntry.cc.

41 {}

Member Function Documentation

bool edm::VParameterSetEntry::isTracked ( ) const
inline
ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)
void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 107 of file VParameterSetEntry.cc.

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

107  {
108  vpset();
109  theIDs = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
110  theIDs->resize(theVPSet->size());
111  for (std::vector<ParameterSet>::iterator i = theVPSet->begin(), e = theVPSet->end(); i != e; ++i) {
112  if (!i->isRegistered()) {
113  i->registerIt();
114  }
115  theIDs->at(i - theVPSet->begin()) = i->id();
116  }
117  }
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 59 of file VParameterSetEntry.cc.

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

59  {
60  assert(theIDs);
61  digest.append(tracked ? "+q{" : "-q{", 3);
62  bool started = false;
63  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
64  if (started)
65  digest.append(",", 1);
66  i->toDigest(digest);
67  started = true;
68  }
69  digest.append("}",1);
70  }
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 72 of file VParameterSetEntry.cc.

References query::result.

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

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

Definition at line 44 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, errorMatrix2Lands_multiChannel::start, theIDs, and tracked.

44  {
45  assert(theIDs);
46  result += tracked ? "+q" : "-q";
47  result += '{';
48  std::string start;
49  std::string const between(",");
50  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
51  result += start;
52  i->toString(result);
53  start = between;
54  }
55  result += '}';
56  }
int i
Definition: DBlmapReader.cc:9
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 78 of file VParameterSetEntry.cc.

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

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

78  {
79  if (!theVPSet) {
80  assert(theIDs);
81  theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
82  theVPSet->reserve(theIDs->size());
83  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
84  theVPSet->push_back(getParameterSet(*i));
85  }
86  }
87  return *theVPSet;
88  }
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 90 of file VParameterSetEntry.cc.

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

90  {
91  if (!theVPSet) {
92  assert(theIDs);
93  theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
94  theVPSet->reserve(theIDs->size());
95  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
96  theVPSet->push_back(getParameterSet(*i));
97  }
98  }
99  return *theVPSet;
100  }
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 119 of file VParameterSetEntry.cc.

119  {
120  std::vector<ParameterSet> const& vps = vpsetEntry.vpset();
121  os << "VPSet "<<(vpsetEntry.isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
122  std::string start;
123  std::string const between(",\n");
124  for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
125  os << start << *i;
126  start = between;
127  }
128  if (!vps.empty()) {
129  os << std::endl;
130  }
131  os << "})";
132  return os;
133  }
int i
Definition: DBlmapReader.cc:9

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 51 of file VParameterSetEntry.h.

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