LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::ProcessHistory Class Reference

#include "ProcessHistory.h"

Classes

struct  Transients
 

Public Types

using value_type = ProcessConfiguration
 
using collection_type = std::vector< value_type >
 
using iterator = collection_type::iterator
 
using const_iterator = collection_type::const_iterator
 
using reverse_iterator = collection_type::reverse_iterator
 
using const_reverse_iterator = collection_type::const_reverse_iterator
 
using reference = collection_type::reference
 
using const_reference = collection_type::const_reference
 
using size_type = collection_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 const & 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.

using art::ProcessHistory::const_iterator = collection_type::const_iterator

Definition at line 25 of file ProcessHistory.h.

using art::ProcessHistory::const_reference = collection_type::const_reference

Definition at line 31 of file ProcessHistory.h.

using art::ProcessHistory::const_reverse_iterator = collection_type::const_reverse_iterator

Definition at line 28 of file ProcessHistory.h.

using art::ProcessHistory::iterator = collection_type::iterator

Definition at line 24 of file ProcessHistory.h.

using art::ProcessHistory::reference = collection_type::reference

Definition at line 30 of file ProcessHistory.h.

using art::ProcessHistory::reverse_iterator = collection_type::reverse_iterator

Definition at line 27 of file ProcessHistory.h.

using art::ProcessHistory::size_type = collection_type::size_type

Definition at line 33 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) {}
collection_type data_
Char_t n[5]
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.

References transients_.

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_(std::move(rhs.data_)), transients_{std::move(rhs.transients_)}
43  {}
Transient< Transients > transients_
collection_type data_

Member Function Documentation

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

Definition at line 134 of file ProcessHistory.cc.

References data_.

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

Definition at line 140 of file ProcessHistory.cc.

References data_.

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

Definition at line 146 of file ProcessHistory.cc.

References data_.

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

Definition at line 110 of file ProcessHistory.cc.

References data_.

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

Definition at line 158 of file ProcessHistory.cc.

References data_.

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

Definition at line 164 of file ProcessHistory.cc.

References data_.

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

Definition at line 182 of file ProcessHistory.cc.

References data_.

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

Definition at line 188 of file ProcessHistory.cc.

References data_.

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

Definition at line 194 of file ProcessHistory.cc.

References data_.

Referenced by art::isAncestor(), and art::operator==().

195  {
196  return data_;
197  }
collection_type data_
bool art::ProcessHistory::empty ( ) const

Definition at line 98 of file ProcessHistory.cc.

References data_.

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

Definition at line 152 of file ProcessHistory.cc.

References data_.

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

Definition at line 72 of file ProcessHistory.cc.

References mutex_.

Referenced by art::Principal::addToProcessHistory(), and art::Principal::findGroups().

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

Definition at line 225 of file ProcessHistory.cc.

References data_, e, and mutex_.

Referenced by art::ProductRetriever::getProcessParameterSet(), and art::TriggerNamesService::pathResults().

226  {
227  std::lock_guard sentry{mutex_};
228  for (const_iterator i = data_.begin(), e = data_.end(); i != e; ++i) {
229  if (i->processName() == name) {
230  return std::make_optional(*i);
231  }
232  }
233  return std::nullopt;
234  }
std::recursive_mutex mutex_
collection_type data_
Float_t e
Definition: plot.C:35
ProcessHistoryID const & art::ProcessHistory::id ( ) const

Definition at line 200 of file ProcessHistory.cc.

References data_, E, mutex_, tmp, and transients_.

Referenced by art::Principal::processHistoryID().

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

Definition at line 50 of file ProcessHistory.cc.

References data_, and transients_.

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.

References data_, and transients_.

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

Definition at line 122 of file ProcessHistory.cc.

References data_.

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

Definition at line 128 of file ProcessHistory.cc.

References data_.

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

Definition at line 91 of file ProcessHistory.cc.

References data_, and transients_.

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

Definition at line 170 of file ProcessHistory.cc.

References data_.

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

Definition at line 176 of file ProcessHistory.cc.

References data_.

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

Definition at line 116 of file ProcessHistory.cc.

References data_.

117  {
118  data_.reserve(n);
119  }
collection_type data_
Char_t n[5]
ProcessHistory::size_type art::ProcessHistory::size ( void  ) const

Definition at line 104 of file ProcessHistory.cc.

References data_.

Referenced by art::isAncestor().

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

Definition at line 82 of file ProcessHistory.cc.

References data_, and transients_.

Referenced by art::swap().

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

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

Definition at line 140 of file ProcessHistory.h.

Referenced by get_mutex(), getConfigurationForProcess(), and id().

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

Definition at line 133 of file ProcessHistory.h.

Referenced by id(), operator=(), ProcessHistory(), push_back(), and swap().


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