CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
 
void fillVPSet () const
 reconstitutes the VPSet from the registry More...
 
bool isTracked () const
 
VParameterSetEntryoperator= (VParameterSetEntry const &)=default
 
VParameterSetEntryoperator= (VParameterSetEntry &&)=default
 
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)
 
 VParameterSetEntry (VParameterSetEntry const &)=default
 
 VParameterSetEntry (VParameterSetEntry &&)=default
 
std::vector< ParameterSet > const & vpset () const
 returns the VPSet More...
 
std::vector< ParameterSet > & vpsetForUpdate ()
 
 ~VParameterSetEntry ()=default
 

Private Attributes

value_ptr< std::vector
< ParameterSetID > > 
theIDs_
 
atomic_value_ptr< std::vector
< ParameterSet > > 
theVPSet_
 
bool tracked_
 

Friends

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

Detailed Description

Definition at line 24 of file VParameterSetEntry.h.

Constructor & Destructor Documentation

edm::VParameterSetEntry::VParameterSetEntry ( )

Definition at line 12 of file VParameterSetEntry.cc.

12 : tracked_(false), theVPSet_(), theIDs_() {}
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
edm::VParameterSetEntry::VParameterSetEntry ( std::vector< ParameterSet > const &  vpset,
bool  isTracked 
)

Definition at line 14 of file VParameterSetEntry.cc.

References alignCSCRings::e, mps_fire::i, and theVPSet_.

15  : tracked_(isTracked), theVPSet_(new std::vector<ParameterSet>), theIDs_() {
16  for (std::vector<ParameterSet>::const_iterator i = vpset.begin(), e = vpset.end(); i != e; ++i) {
17  theVPSet_->push_back(*i);
18  }
19  }
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet > const & vpset() const
returns the VPSet
edm::VParameterSetEntry::VParameterSetEntry ( std::string const &  rep)

Definition at line 21 of file VParameterSetEntry.cc.

References cms::cuda::assert(), alignCSCRings::e, mps_fire::i, edm::split(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and theIDs_.

22  : tracked_(rep[0] == '+'), theVPSet_(), theIDs_(new std::vector<ParameterSetID>) {
23  assert(rep[0] == '+' || rep[0] == '-');
24  std::vector<std::string> temp;
25  // need a substring that starts at the '{'
26  std::string bracketedRepr(rep.begin() + 2, rep.end());
27  split(std::back_inserter(temp), bracketedRepr, '{', ',', '}');
28  theIDs_->reserve(temp.size());
29  for (std::vector<std::string>::const_iterator i = temp.begin(), e = temp.end(); i != e; ++i) {
30  theIDs_->push_back(ParameterSetID(*i));
31  }
32  }
string rep
Definition: cuy.py:1189
assert(be >=bs)
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
bool split(OutIter result, std::string const &string_to_split, char first, char sep, char last)
Definition: split.h:68
Hash< ParameterSetType > ParameterSetID
edm::VParameterSetEntry::~VParameterSetEntry ( )
default
edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry const &  )
default
edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry &&  )
default

Member Function Documentation

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

Definition at line 119 of file VParameterSetEntry.cc.

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

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

119  {
120  std::string indentation(indent, ' ');
121  std::ostringstream os;
122  std::vector<ParameterSet> const& vps = vpset();
123  os << "VPSet " << (isTracked() ? "tracked" : "untracked") << " = ({" << std::endl;
125  std::string const between(",\n");
126  for (std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
127  os << start << indentation << i->dump(indent);
128  start = between;
129  }
130  if (!vps.empty()) {
131  os << std::endl;
132  }
133  os << indentation << "})";
134  return os.str();
135  }
std::vector< ParameterSet > const & vpset() const
returns the VPSet
void edm::VParameterSetEntry::fillVPSet ( ) const

reconstitutes the VPSet from the registry

Definition at line 81 of file VParameterSetEntry.cc.

References edm::getParameterSet(), theIDs_, theVPSet_, and createJobs::tmp.

Referenced by registerPsetsAndUpdateIDs(), vpset(), and vpsetForUpdate().

81  {
82  if (nullptr == theVPSet_.load()) {
83  auto tmp = std::make_unique<std::vector<ParameterSet>>();
84  tmp->reserve(theIDs_->size());
85  for (auto const& theID : *theIDs_) {
86  tmp->push_back(getParameterSet(theID));
87  }
88  VParameterSet* expected = nullptr;
89  if (theVPSet_.compare_exchange_strong(expected, tmp.get())) {
90  // theVPSet_ was equal to nullptr and now is equal to tmp.get()
91  tmp.release();
92  }
93  }
94  }
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:34
ParameterSet const & getParameterSet(ParameterSetID const &id)
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
tmp
align.sh
Definition: createJobs.py:716
bool edm::VParameterSetEntry::isTracked ( ) const
inline
VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry const &  )
default
VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry &&  )
default
ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)
void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 107 of file VParameterSetEntry.cc.

References alignCSCRings::e, fillVPSet(), mps_fire::i, theIDs_, and theVPSet_.

107  {
108  fillVPSet();
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  }
void fillVPSet() const
reconstitutes the VPSet from the registry
value_ptr< std::vector< ParameterSetID > > theIDs_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet >::size_type edm::VParameterSetEntry::size ( void  ) const
void edm::VParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 48 of file VParameterSetEntry.cc.

References cms::Digest::append(), cms::cuda::assert(), alignCSCRings::e, mps_fire::i, theIDs_, and tracked_.

48  {
49  assert(theIDs_);
50  digest.append(tracked_ ? "+q{" : "-q{", 3);
51  bool started = false;
52  for (std::vector<ParameterSetID>::const_iterator i = theIDs_->begin(), e = theIDs_->end(); i != e; ++i) {
53  if (started)
54  digest.append(",", 1);
55  i->toDigest(digest);
56  started = true;
57  }
58  digest.append("}", 1);
59  }
assert(be >=bs)
value_ptr< std::vector< ParameterSetID > > theIDs_
void append(std::string const &s)
Definition: Digest.cc:161
std::string edm::VParameterSetEntry::toString ( ) const

Definition at line 61 of file VParameterSetEntry.cc.

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

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

61  {
63  toString(result);
64  return result;
65  }
tuple result
Definition: mps_fire.py:311
std::string toString() const
void edm::VParameterSetEntry::toString ( std::string &  result) const

Definition at line 34 of file VParameterSetEntry.cc.

References cms::cuda::assert(), alignCSCRings::e, mps_fire::i, command_line::start, AlCaHLTBitMon_QueryRunRegistry::string, theIDs_, and tracked_.

34  {
35  assert(theIDs_);
36  result += tracked_ ? "+q" : "-q";
37  result += '{';
39  std::string const between(",");
40  for (std::vector<ParameterSetID>::const_iterator i = theIDs_->begin(), e = theIDs_->end(); i != e; ++i) {
41  result += start;
42  i->toString(result);
43  start = between;
44  }
45  result += '}';
46  }
assert(be >=bs)
tuple result
Definition: mps_fire.py:311
value_ptr< std::vector< ParameterSetID > > theIDs_
std::vector< ParameterSet > const & edm::VParameterSetEntry::vpset ( ) const

returns the VPSet

Definition at line 67 of file VParameterSetEntry.cc.

References fillVPSet(), and theVPSet_.

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

67  {
68  fillVPSet();
69  return *theVPSet_;
70  }
void fillVPSet() const
reconstitutes the VPSet from the registry
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
std::vector< ParameterSet > & edm::VParameterSetEntry::vpsetForUpdate ( )

Definition at line 76 of file VParameterSetEntry.cc.

References fillVPSet(), and theVPSet_.

Referenced by FWPSetTableManager::handleVPSetEntry().

76  {
77  fillVPSet();
78  return *theVPSet_;
79  }
void fillVPSet() const
reconstitutes the VPSet from the registry
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_

Friends And Related Function Documentation

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

Definition at line 137 of file VParameterSetEntry.cc.

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

Member Data Documentation

value_ptr<std::vector<ParameterSetID> > edm::VParameterSetEntry::theIDs_
private
atomic_value_ptr<std::vector<ParameterSet> > edm::VParameterSetEntry::theVPSet_
mutableprivate
bool edm::VParameterSetEntry::tracked_
private

Definition at line 58 of file VParameterSetEntry.h.

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