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

11  : tracked(false),
12  theVPSet(),
13  theIDs()
14  {
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 ExpressReco_HICollisions_FallBack::e, i, and theVPSet.

18  : tracked(isTracked),
19  theVPSet(new std::vector<ParameterSet>),
20  theIDs()
21  {
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 ExpressReco_HICollisions_FallBack::e, i, edm::split(), cond::rpcobtemp::temp, and theIDs.

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

43 {}

Member Function Documentation

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

Definition at line 83 of file VParameterSetEntry.cc.

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

83  {
84  vpset();
85  theIDs = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
86  theIDs->resize(theVPSet->size());
87  for (std::vector<ParameterSet>::iterator i = theVPSet->begin(), e = theVPSet->end(); i != e; ++i) {
88  if (!i->isRegistered()) {
89  i->registerIt();
90  }
91  theIDs->at(i - theVPSet->begin()) = i->id();
92  }
93  }
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
std::string edm::VParameterSetEntry::toString ( ) const

Definition at line 60 of file VParameterSetEntry.cc.

References query::result.

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

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

Definition at line 46 of file VParameterSetEntry.cc.

References ExpressReco_HICollisions_FallBack::e, i, theIDs, and tracked.

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

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

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

66  {
67  if (!theVPSet) {
68  assert(theIDs);
69  theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
70  theVPSet->reserve(theIDs->size());
71  for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
72  theVPSet->push_back(getParameterSet(*i));
73  }
74  }
75  return *theVPSet;
76  }
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 95 of file VParameterSetEntry.cc.

95  {
96  std::vector<ParameterSet> const& vps = vpsetEntry.vpset();
97  os << "VPSet "<<(vpsetEntry.isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
98  std::string start;
99  std::string const between(",\n");
100  for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
101  os << start << *i;
102  start = between;
103  }
104  if (!vps.empty()) {
105  os << std::endl;
106  }
107  os << "})";
108  return os;
109  }
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 49 of file VParameterSetEntry.h.

Referenced by isTracked(), and toString().