CMS 3D CMS Logo

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 &&)=default
 
VParameterSetEntryoperator= (VParameterSetEntry const &)=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::string const &rep)
 
 VParameterSetEntry (std::vector< ParameterSet > const &vpset, bool isTracked)
 
 VParameterSetEntry (VParameterSetEntry &&)=default
 
 VParameterSetEntry (VParameterSetEntry const &)=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

◆ VParameterSetEntry() [1/5]

edm::VParameterSetEntry::VParameterSetEntry ( )

Definition at line 12 of file VParameterSetEntry.cc.

12 : tracked_(false), theVPSet_(), theIDs_() {}

◆ VParameterSetEntry() [2/5]

edm::VParameterSetEntry::VParameterSetEntry ( std::vector< ParameterSet > const &  vpset,
bool  isTracked 
)

Definition at line 14 of file VParameterSetEntry.cc.

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  }

References MillePedeFileConverter_cfg::e, mps_fire::i, theVPSet_, and vpset().

◆ VParameterSetEntry() [3/5]

edm::VParameterSetEntry::VParameterSetEntry ( std::string const &  rep)

Definition at line 21 of file VParameterSetEntry.cc.

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  }

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

◆ ~VParameterSetEntry()

edm::VParameterSetEntry::~VParameterSetEntry ( )
default

◆ VParameterSetEntry() [4/5]

edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry const &  )
default

◆ VParameterSetEntry() [5/5]

edm::VParameterSetEntry::VParameterSetEntry ( VParameterSetEntry &&  )
default

Member Function Documentation

◆ dump()

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

Definition at line 119 of file VParameterSetEntry.cc.

119  {
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  }

References MillePedeFileConverter_cfg::e, mps_fire::i, util.rrClient::indent, printContent_cfi::indentation, isTracked(), command_line::start, AlCaHLTBitMon_QueryRunRegistry::string, and vpset().

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

◆ fillVPSet()

void edm::VParameterSetEntry::fillVPSet ( ) const

reconstitutes the VPSet from the registry

Definition at line 81 of file VParameterSetEntry.cc.

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  }

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

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

◆ isTracked()

bool edm::VParameterSetEntry::isTracked ( ) const
inline

◆ operator=() [1/2]

VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry &&  )
default

◆ operator=() [2/2]

VParameterSetEntry& edm::VParameterSetEntry::operator= ( VParameterSetEntry const &  )
default

◆ psetInVector()

ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)

◆ registerPsetsAndUpdateIDs()

void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 107 of file VParameterSetEntry.cc.

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  }

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

◆ size()

std::vector< ParameterSet >::size_type edm::VParameterSetEntry::size ( void  ) const

◆ toDigest()

void edm::VParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 48 of file VParameterSetEntry.cc.

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  }

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

◆ toString() [1/2]

std::string edm::VParameterSetEntry::toString ( ) const

Definition at line 61 of file VParameterSetEntry.cc.

61  {
64  return result;
65  }

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

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

◆ toString() [2/2]

void edm::VParameterSetEntry::toString ( std::string &  result) const

Definition at line 34 of file VParameterSetEntry.cc.

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  }

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

◆ vpset()

std::vector< ParameterSet > const & edm::VParameterSetEntry::vpset ( ) const

returns the VPSet

Definition at line 67 of file VParameterSetEntry.cc.

67  {
68  fillVPSet();
69  return *theVPSet_;
70  }

References fillVPSet(), and theVPSet_.

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

◆ vpsetForUpdate()

std::vector< ParameterSet > & edm::VParameterSetEntry::vpsetForUpdate ( )

Definition at line 76 of file VParameterSetEntry.cc.

76  {
77  fillVPSet();
78  return *theVPSet_;
79  }

References fillVPSet(), and theVPSet_.

Friends And Related Function Documentation

◆ operator<<

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

◆ theIDs_

value_ptr<std::vector<ParameterSetID> > edm::VParameterSetEntry::theIDs_
private

◆ theVPSet_

atomic_value_ptr<std::vector<ParameterSet> > edm::VParameterSetEntry::theVPSet_
mutableprivate

◆ tracked_

bool edm::VParameterSetEntry::tracked_
private

Definition at line 58 of file VParameterSetEntry.h.

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

edm::VParameterSetEntry::tracked_
bool tracked_
Definition: VParameterSetEntry.h:58
edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
cms::Digest::append
void append(std::string const &s)
Definition: Digest.cc:161
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
edm::VParameterSetEntry::isTracked
bool isTracked() const
Definition: VParameterSetEntry.h:41
cms::cuda::assert
assert(be >=bs)
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:34
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::VParameterSetEntry::vpset
std::vector< ParameterSet > const & vpset() const
returns the VPSet
Definition: VParameterSetEntry.cc:67
edm::VParameterSetEntry::theIDs_
value_ptr< std::vector< ParameterSetID > > theIDs_
Definition: VParameterSetEntry.h:60
edm::VParameterSetEntry::theVPSet_
atomic_value_ptr< std::vector< ParameterSet > > theVPSet_
Definition: VParameterSetEntry.h:59
edm::VParameterSetEntry::fillVPSet
void fillVPSet() const
reconstitutes the VPSet from the registry
Definition: VParameterSetEntry.cc:81
cuy.rep
rep
Definition: cuy.py:1189
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862
util.rrClient.indent
indent
Definition: rrClient.py:41
edm::VParameterSetEntry::toString
std::string toString() const
Definition: VParameterSetEntry.cc:61
printContent_cfi.indentation
indentation
Definition: printContent_cfi.py:10
mps_fire.result
result
Definition: mps_fire.py:311
command_line.start
start
Definition: command_line.py:167
edm::split
bool split(OutIter result, std::string const &string_to_split, char first, char sep, char last)
Definition: split.h:68
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37