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 13 of file HistoryAppender.h.

Constructor & Destructor Documentation

◆ HistoryAppender() [1/2]

edm::HistoryAppender::HistoryAppender ( )

Definition at line 19 of file HistoryAppender.cc.

19 {}

◆ HistoryAppender() [2/2]

edm::HistoryAppender::HistoryAppender ( HistoryAppender const &  )
privatedelete

Member Function Documentation

◆ appendToProcessHistory()

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

Definition at line 21 of file HistoryAppender.cc.

22  {
23  assert((iInputProcessHistory) == nullptr or (inputPHID == iInputProcessHistory->id()));
24  if (m_cachedHistory.get() != nullptr and inputPHID == m_cachedInputPHID) {
25  return m_cachedHistory;
26  }
27 
28  ProcessHistory const* inputProcessHistory = iInputProcessHistory ? iInputProcessHistory : &s_emptyHistory;
29 
30  if (inputPHID.isValid()) {
31  if (iInputProcessHistory == nullptr) {
32  throw Exception(errors::LogicError) << "HistoryAppender::appendToProcessHistory\n"
33  << "Input ProcessHistory has valid ID but is nullptr\n"
34  << "Contact a Framework developer\n";
35  }
36  }
37 
38  auto newProcessHistory = std::make_shared<ProcessHistory>();
39  *newProcessHistory = *inputProcessHistory;
40  checkProcessHistory(*newProcessHistory, pc);
41  newProcessHistory->push_back(pc);
42  //force it to create the ID
43  newProcessHistory->setProcessHistoryID();
44  m_cachedInputPHID = inputPHID;
45  m_cachedHistory = newProcessHistory;
46  return m_cachedHistory;
47  }

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

◆ checkProcessHistory()

void edm::HistoryAppender::checkProcessHistory ( ProcessHistory const &  ph,
ProcessConfiguration const &  pc 
) const
private

Definition at line 49 of file HistoryAppender.cc.

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

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

Referenced by appendToProcessHistory().

◆ operator=()

HistoryAppender& edm::HistoryAppender::operator= ( HistoryAppender const &  )
privatedelete

Member Data Documentation

◆ m_cachedHistory

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

Definition at line 33 of file HistoryAppender.h.

Referenced by appendToProcessHistory().

◆ m_cachedInputPHID

ProcessHistoryID edm::HistoryAppender::m_cachedInputPHID
private

Definition at line 32 of file HistoryAppender.h.

Referenced by appendToProcessHistory().

edm::errors::LogicError
Definition: EDMException.h:37
ProducerES_cfi.ProcessHistory
ProcessHistory
Definition: ProducerES_cfi.py:14
edm::HistoryAppender::checkProcessHistory
void checkProcessHistory(ProcessHistory const &ph, ProcessConfiguration const &pc) const
Definition: HistoryAppender.cc:49
cms::cuda::assert
assert(be >=bs)
edm::HistoryAppender::m_cachedHistory
std::shared_ptr< ProcessHistory const > m_cachedHistory
Definition: HistoryAppender.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
s_emptyHistory
static const edm::ProcessHistory s_emptyHistory
Definition: HistoryAppender.cc:15
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
Exception
Definition: hltDiff.cc:246
or
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
edm::HistoryAppender::m_cachedInputPHID
ProcessHistoryID m_cachedInputPHID
Definition: HistoryAppender.h:32
edm::errors::Configuration
Definition: EDMException.h:36