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

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

References i, and theVPSet.

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

References i, edm::split(), cond::rpcobtemp::temp, and theIDs.

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

40 {}

Member Function Documentation

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

Definition at line 92 of file VParameterSetEntry.cc.

References i, theIDs, theVPSet, and vpset().

92  {
93  vpset();
94  theIDs = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
95  theIDs->resize(theVPSet->size());
96  for (std::vector<ParameterSet>::iterator i = theVPSet->begin(), e = theVPSet->end(); i != e; ++i) {
97  if (!i->isRegistered()) {
98  i->registerIt();
99  }
100  theIDs->at(i - theVPSet->begin()) = i->id();
101  }
102  }
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 57 of file VParameterSetEntry.cc.

References query::result.

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

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

Definition at line 43 of file VParameterSetEntry.cc.

References i, theIDs, and tracked.

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

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

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

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

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

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

104  {
105  std::vector<ParameterSet> const& vps = vpsetEntry.vpset();
106  os << "VPSet "<<(vpsetEntry.isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
107  std::string start;
108  std::string const between(",\n");
109  for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
110  os << start << *i;
111  start = between;
112  }
113  if (!vps.empty()) {
114  os << std::endl;
115  }
116  os << "})";
117  return os;
118  }
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 50 of file VParameterSetEntry.h.

Referenced by isTracked(), and toString().