CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::messagedrop::StringProducerWithPhase Class Reference
Inheritance diagram for edm::messagedrop::StringProducerWithPhase:
edm::messagedrop::StringProducer

Public Member Functions

void set (std::string const &name, std::string const &label, unsigned int moduleID, const char *phase)
 
 StringProducerWithPhase ()
 
std::string theContext () const override
 
- Public Member Functions inherited from edm::messagedrop::StringProducer
virtual ~StringProducer ()
 

Private Attributes

std::string cache_
 
std::map< unsigned int, std::string > idLabelMap_
 
std::string const * label_
 
unsigned int moduleID_
 
std::string const * name_
 
const char * phasePtr_
 

Detailed Description

Definition at line 77 of file MessageDrop.cc.

Constructor & Destructor Documentation

◆ StringProducerWithPhase()

edm::messagedrop::StringProducerWithPhase::StringProducerWithPhase ( )
inline

Definition at line 79 of file MessageDrop.cc.

80  : name_(&kBlankString),
81  label_(&kBlankString),
82  phasePtr_("(Startup)"),
84  cache_(),
85  idLabelMap_() {}

Member Function Documentation

◆ set()

void edm::messagedrop::StringProducerWithPhase::set ( std::string const &  name,
std::string const &  label,
unsigned int  moduleID,
const char *  phase 
)
inline

Definition at line 105 of file MessageDrop.cc.

105  {
106  name_ = &name;
107  label_ = &label;
108  moduleID_ = moduleID;
109  phasePtr_ = phase;
110  cache_.clear();
111  }

References cache_, label, label_, moduleID_, Skims_PA_cff::name, name_, HLT_2018_cff::phase, and phasePtr_.

◆ theContext()

std::string edm::messagedrop::StringProducerWithPhase::theContext ( ) const
inlineoverridevirtual

Implements edm::messagedrop::StringProducer.

Definition at line 87 of file MessageDrop.cc.

87  {
88  if (cache_.empty()) {
90  auto nameLableIter = idLabelMap_.find(moduleID_);
91  if (nameLableIter != idLabelMap_.end()) {
92  cache_.assign(nameLableIter->second);
93  cache_.append(phasePtr_);
94  return cache_;
95  }
96  }
97  cache_.assign(*name_);
98  cache_.append(":");
99  cache_.append(*label_);
101  cache_.append(phasePtr_);
102  }
103  return cache_;
104  }

References cache_, idLabelMap_, label_, SiStripPI::max, moduleID_, name_, and phasePtr_.

Member Data Documentation

◆ cache_

std::string edm::messagedrop::StringProducerWithPhase::cache_
mutableprivate

Definition at line 120 of file MessageDrop.cc.

Referenced by set(), and theContext().

◆ idLabelMap_

std::map<unsigned int, std::string> edm::messagedrop::StringProducerWithPhase::idLabelMap_
mutableprivate

Definition at line 121 of file MessageDrop.cc.

Referenced by theContext().

◆ label_

std::string const* edm::messagedrop::StringProducerWithPhase::label_
private

◆ moduleID_

unsigned int edm::messagedrop::StringProducerWithPhase::moduleID_
private

Definition at line 117 of file MessageDrop.cc.

Referenced by set(), and theContext().

◆ name_

std::string const* edm::messagedrop::StringProducerWithPhase::name_
private

Definition at line 114 of file MessageDrop.cc.

Referenced by set(), and theContext().

◆ phasePtr_

const char* edm::messagedrop::StringProducerWithPhase::phasePtr_
private

Definition at line 116 of file MessageDrop.cc.

Referenced by set(), and theContext().

edm::messagedrop::StringProducerWithPhase::idLabelMap_
std::map< unsigned int, std::string > idLabelMap_
Definition: MessageDrop.cc:121
HLT_2018_cff.phase
phase
Definition: HLT_2018_cff.py:5346
edm::messagedrop::StringProducerWithPhase::moduleID_
unsigned int moduleID_
Definition: MessageDrop.cc:117
edm::messagedrop::StringProducerWithPhase::label_
std::string const * label_
Definition: MessageDrop.cc:115
edm::messagedrop::StringProducerWithPhase::phasePtr_
const char * phasePtr_
Definition: MessageDrop.cc:116
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::messagedrop::StringProducerWithPhase::cache_
std::string cache_
Definition: MessageDrop.cc:120
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::messagedrop::StringProducerWithPhase::name_
std::string const * name_
Definition: MessageDrop.cc:114
label
const char * label
Definition: PFTauDecayModeTools.cc:11