Classes | Public Types | Public Member Functions | Private Attributes | List of all members
art::ProcessHistory Class Reference

#include <ProcessHistory.h>

Classes

struct  Transients
 

Public Types

typedef ProcessConfiguration value_type
 
typedef std::vector< value_typecollection_type
 
typedef collection_type::iterator iterator
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::reference reference
 
typedef collection_type::const_reference const_reference
 
typedef collection_type::size_type size_type
 

Public Member Functions

 ~ProcessHistory ()
 
 ProcessHistory ()
 
 ProcessHistory (size_type n)
 
 ProcessHistory (collection_type const &vec)
 
 ProcessHistory (ProcessHistory const &)
 
 ProcessHistory (ProcessHistory &&)
 
ProcessHistoryoperator= (ProcessHistory const &)
 
ProcessHistoryoperator= (ProcessHistory &&)
 
std::recursive_mutex & get_mutex () const
 
void swap (ProcessHistory &other)
 
void push_back (const_reference t)
 
bool empty () const
 
size_type size () const
 
size_type capacity () const
 
void reserve (size_type n)
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
collection_type const & data () const
 
ProcessHistoryID id () const
 
std::optional< ProcessConfigurationgetConfigurationForProcess (std::string const &name) const
 

Private Attributes

collection_type data_ {}
 
Transient< Transientstransients_ {}
 
std::recursive_mutex mutex_ {}
 

Detailed Description

Definition at line 19 of file ProcessHistory.h.

Member Typedef Documentation

Definition at line 22 of file ProcessHistory.h.

typedef collection_type::const_iterator art::ProcessHistory::const_iterator

Definition at line 25 of file ProcessHistory.h.

typedef collection_type::const_reference art::ProcessHistory::const_reference

Definition at line 31 of file ProcessHistory.h.

typedef collection_type::const_reverse_iterator art::ProcessHistory::const_reverse_iterator

Definition at line 28 of file ProcessHistory.h.

typedef collection_type::iterator art::ProcessHistory::iterator

Definition at line 24 of file ProcessHistory.h.

typedef collection_type::reference art::ProcessHistory::reference

Definition at line 30 of file ProcessHistory.h.

typedef collection_type::reverse_iterator art::ProcessHistory::reverse_iterator

Definition at line 27 of file ProcessHistory.h.

typedef collection_type::size_type art::ProcessHistory::size_type

Definition at line 33 of file ProcessHistory.h.

Definition at line 21 of file ProcessHistory.h.

Constructor & Destructor Documentation

art::ProcessHistory::~ProcessHistory ( )
default
art::ProcessHistory::ProcessHistory ( )
default
art::ProcessHistory::ProcessHistory ( size_type  n)
explicit

Definition at line 24 of file ProcessHistory.cc.

24 : data_(n) {}
std::void_t< T > n
collection_type data_
art::ProcessHistory::ProcessHistory ( collection_type const &  vec)
explicit

Definition at line 27 of file ProcessHistory.cc.

27 : data_(vec) {}
collection_type data_
art::ProcessHistory::ProcessHistory ( ProcessHistory const &  rhs)

Definition at line 33 of file ProcessHistory.cc.

34  : data_(rhs.data_), transients_{rhs.transients_}
35  {}
Transient< Transients > transients_
collection_type data_
art::ProcessHistory::ProcessHistory ( ProcessHistory &&  rhs)

Definition at line 41 of file ProcessHistory.cc.

42  : data_(move(rhs.data_)), transients_{move(rhs.transients_)}
43  {}
Transient< Transients > transients_
def move(depos, offset)
Definition: depos.py:107
collection_type data_

Member Function Documentation

ProcessHistory::reference art::ProcessHistory::at ( size_type  i)

Definition at line 132 of file ProcessHistory.cc.

133  {
134  return data_.at(i);
135  }
collection_type data_
ProcessHistory::const_reference art::ProcessHistory::at ( size_type  i) const

Definition at line 138 of file ProcessHistory.cc.

139  {
140  return data_.at(i);
141  }
collection_type data_
ProcessHistory::const_iterator art::ProcessHistory::begin ( ) const

Definition at line 144 of file ProcessHistory.cc.

145  {
146  return data_.begin();
147  }
collection_type data_
ProcessHistory::size_type art::ProcessHistory::capacity ( ) const

Definition at line 110 of file ProcessHistory.cc.

111  {
112  return data_.capacity();
113  }
collection_type data_
ProcessHistory::const_iterator art::ProcessHistory::cbegin ( ) const

Definition at line 156 of file ProcessHistory.cc.

157  {
158  return data_.cbegin();
159  }
collection_type data_
ProcessHistory::const_iterator art::ProcessHistory::cend ( ) const

Definition at line 162 of file ProcessHistory.cc.

163  {
164  return data_.cend();
165  }
collection_type data_
ProcessHistory::const_reverse_iterator art::ProcessHistory::crbegin ( ) const

Definition at line 180 of file ProcessHistory.cc.

181  {
182  return data_.crbegin();
183  }
collection_type data_
ProcessHistory::const_reverse_iterator art::ProcessHistory::crend ( ) const

Definition at line 186 of file ProcessHistory.cc.

187  {
188  return data_.crend();
189  }
collection_type data_
ProcessHistory::collection_type const & art::ProcessHistory::data ( ) const

Definition at line 192 of file ProcessHistory.cc.

193  {
194  return data_;
195  }
collection_type data_
bool art::ProcessHistory::empty ( ) const

Definition at line 98 of file ProcessHistory.cc.

99  {
100  return data_.empty();
101  }
collection_type data_
ProcessHistory::const_iterator art::ProcessHistory::end ( ) const

Definition at line 150 of file ProcessHistory.cc.

151  {
152  return data_.end();
153  }
collection_type data_
std::recursive_mutex & art::ProcessHistory::get_mutex ( ) const

Definition at line 72 of file ProcessHistory.cc.

73  {
74  return mutex_;
75  }
std::recursive_mutex mutex_
std::optional< ProcessConfiguration > art::ProcessHistory::getConfigurationForProcess ( std::string const &  name) const

Definition at line 223 of file ProcessHistory.cc.

224  {
225  std::lock_guard sentry{mutex_};
226  for (const_iterator i = data_.begin(), e = data_.end(); i != e; ++i) {
227  if (i->processName() == name) {
228  return std::make_optional(*i);
229  }
230  }
231  return std::nullopt;
232  }
static QCString name
Definition: declinfo.cpp:673
std::recursive_mutex mutex_
const double e
collection_type data_
ProcessHistoryID art::ProcessHistory::id ( ) const

Definition at line 198 of file ProcessHistory.cc.

199  {
200  // Note: threading: We may be called by Principal::addProcessEntry()
201  // Note: threading: with the mutex already locked, so we use
202  // a recursive mutex.
203  std::lock_guard sentry{mutex_};
204  if (transients_.get().phid_.isValid()) {
205  return transients_.get().phid_;
206  }
207  // This implementation is ripe for optimization.
208  // We do not use operator<< because it does not write out everything.
209  ostringstream oss;
210  for (auto I = data_.begin(), E = data_.end(); I != E; ++I) {
211  oss << I->processName() << ' ' << I->parameterSetID() << ' '
212  << I->releaseVersion() << ' '
213  << ' '; // retain extra spaces for backwards compatibility
214  }
215  string stringrep = oss.str();
216  cet::MD5Digest md5alg(stringrep);
217  ProcessHistoryID tmp(md5alg.digest().toString());
218  transients_.get().phid_.swap(tmp);
219  return transients_.get().phid_;
220  }
std::recursive_mutex mutex_
Transient< Transients > transients_
Hash< ProcessHistoryType > ProcessHistoryID
string tmp
Definition: languages.py:63
collection_type data_
E
Definition: 018_def.c:13
ProcessHistory & art::ProcessHistory::operator= ( ProcessHistory const &  rhs)

Definition at line 50 of file ProcessHistory.cc.

51  {
52  if (this != &rhs) {
53  data_ = rhs.data_;
54  transients_ = rhs.transients_;
55  }
56  return *this;
57  }
Transient< Transients > transients_
collection_type data_
ProcessHistory & art::ProcessHistory::operator= ( ProcessHistory &&  rhs)

Definition at line 64 of file ProcessHistory.cc.

65  {
66  data_ = move(rhs.data_);
67  transients_ = move(rhs.transients_);
68  return *this;
69  }
Transient< Transients > transients_
def move(depos, offset)
Definition: depos.py:107
collection_type data_
ProcessHistory::reference art::ProcessHistory::operator[] ( size_type  i)

Definition at line 121 of file ProcessHistory.cc.

122  {
123  return data_[i];
124  }
collection_type data_
ProcessHistory::const_reference art::ProcessHistory::operator[] ( size_type  i) const

Definition at line 126 of file ProcessHistory.cc.

127  {
128  return data_[i];
129  }
collection_type data_
void art::ProcessHistory::push_back ( const_reference  t)

Definition at line 91 of file ProcessHistory.cc.

92  {
93  data_.push_back(t);
94  transients_.get().phid_ = ProcessHistoryID();
95  }
Transient< Transients > transients_
Hash< ProcessHistoryType > ProcessHistoryID
collection_type data_
ProcessHistory::const_reverse_iterator art::ProcessHistory::rbegin ( ) const

Definition at line 168 of file ProcessHistory.cc.

169  {
170  return data_.rbegin();
171  }
collection_type data_
ProcessHistory::const_reverse_iterator art::ProcessHistory::rend ( ) const

Definition at line 174 of file ProcessHistory.cc.

175  {
176  return data_.rend();
177  }
collection_type data_
void art::ProcessHistory::reserve ( size_type  n)

Definition at line 116 of file ProcessHistory.cc.

117  {
118  data_.reserve(n);
119  }
std::void_t< T > n
collection_type data_
ProcessHistory::size_type art::ProcessHistory::size ( ) const

Definition at line 104 of file ProcessHistory.cc.

105  {
106  return data_.size();
107  }
collection_type data_
void art::ProcessHistory::swap ( ProcessHistory other)

Definition at line 82 of file ProcessHistory.cc.

83  {
84  data_.swap(other.data_);
85  transients_.get().phid_.swap(other.transients_.get().phid_);
86  }
Transient< Transients > transients_
collection_type data_

Member Data Documentation

collection_type art::ProcessHistory::data_ {}
private

Definition at line 132 of file ProcessHistory.h.

std::recursive_mutex art::ProcessHistory::mutex_ {}
mutableprivate

Definition at line 140 of file ProcessHistory.h.

Transient<Transients> art::ProcessHistory::transients_ {}
mutableprivate

Definition at line 133 of file ProcessHistory.h.


The documentation for this class was generated from the following files: