CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::HistoryAppender Class Reference

#include <HistoryAppender.h>

Public Member Functions

std::shared_ptr< ProcessHistory const > appendToProcessHistory (ProcessHistoryID const &inputPHID, ProcessHistory const *inputProcessHistory, ProcessConfiguration const &pc)
 
 HistoryAppender ()
 

Private Member Functions

void checkProcessHistory (ProcessHistory const &ph, ProcessConfiguration const &pc) const
 
 HistoryAppender (HistoryAppender const &)=delete
 
HistoryAppenderoperator= (HistoryAppender const &)=delete
 

Private Attributes

std::shared_ptr< ProcessHistory const > m_cachedHistory
 
ProcessHistoryID m_cachedInputPHID
 

Detailed Description

Definition at line 14 of file HistoryAppender.h.

Constructor & Destructor Documentation

edm::HistoryAppender::HistoryAppender ( )

Definition at line 20 of file HistoryAppender.cc.

20 {}
edm::HistoryAppender::HistoryAppender ( HistoryAppender const &  )
privatedelete

Member Function Documentation

std::shared_ptr< ProcessHistory const > edm::HistoryAppender::appendToProcessHistory ( ProcessHistoryID const &  inputPHID,
ProcessHistory const *  inputProcessHistory,
ProcessConfiguration const &  pc 
)

Definition at line 22 of file HistoryAppender.cc.

References checkProcessHistory(), Exception, edm::ProcessHistory::id(), edm::errors::LogicError, m_cachedHistory, m_cachedInputPHID, or, and s_emptyHistory.

23  {
24  assert((iInputProcessHistory) == nullptr or (inputPHID == iInputProcessHistory->id()));
25  if (m_cachedHistory.get() != nullptr and inputPHID == m_cachedInputPHID) {
26  return m_cachedHistory;
27  }
28 
29  ProcessHistory const* inputProcessHistory = iInputProcessHistory ? iInputProcessHistory : &s_emptyHistory;
30 
31  if (inputPHID.isValid()) {
32  if (iInputProcessHistory == nullptr) {
33  throw Exception(errors::LogicError) << "HistoryAppender::appendToProcessHistory\n"
34  << "Input ProcessHistory has valid ID but is nullptr\n"
35  << "Contact a Framework developer\n";
36  }
37  }
38 
39  auto newProcessHistory = std::make_shared<ProcessHistory>();
40  *newProcessHistory = *inputProcessHistory;
41  checkProcessHistory(*newProcessHistory, pc);
42  newProcessHistory->push_back(pc);
43  //force it to create the ID
44  newProcessHistory->setProcessHistoryID();
45  m_cachedInputPHID = inputPHID;
46  m_cachedHistory = newProcessHistory;
47  return m_cachedHistory;
48  }
ProcessHistoryID m_cachedInputPHID
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static const edm::ProcessHistory s_emptyHistory
void checkProcessHistory(ProcessHistory const &ph, ProcessConfiguration const &pc) const
std::shared_ptr< ProcessHistory const > m_cachedHistory
void edm::HistoryAppender::checkProcessHistory ( ProcessHistory const &  ph,
ProcessConfiguration const &  pc 
) const
private

Definition at line 50 of file HistoryAppender.cc.

References edm::errors::Configuration, Exception, LaserDQM_cfg::process, modifiedElectrons_cfi::processName, edm::ProcessConfiguration::processName(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by appendToProcessHistory().

50  {
51  std::string const& processName = pc.processName();
52  for (auto const& process : ph) {
53  if (processName == process.processName()) {
54  throw edm::Exception(errors::Configuration, "Duplicate Process.")
55  << "The process name " << processName << " was already in the ProcessHistory.\n"
56  << "Please modify the configuration file to use a distinct process name.\n";
57  }
58  }
59  }
HistoryAppender& edm::HistoryAppender::operator= ( HistoryAppender const &  )
privatedelete

Member Data Documentation

std::shared_ptr<ProcessHistory const> edm::HistoryAppender::m_cachedHistory
private

Definition at line 34 of file HistoryAppender.h.

Referenced by appendToProcessHistory().

ProcessHistoryID edm::HistoryAppender::m_cachedInputPHID
private

Definition at line 33 of file HistoryAppender.h.

Referenced by appendToProcessHistory().