Public Member Functions | Private Types | Private Attributes | List of all members
mf::MessageDrop::StringProducerWithPhase Class Reference
Inheritance diagram for mf::MessageDrop::StringProducerWithPhase:
mf::MessageDrop::StringProducer

Public Member Functions

virtual string theContext () const override
 
void set (string const &name, string const &label, module_id_t moduleID, string const &phase)
 
- Public Member Functions inherited from mf::MessageDrop::StringProducer
virtual ~StringProducer () noexcept=default
 

Private Types

using id_label_map_t = map< module_id_t, string >
 

Private Attributes

string phase_ {"@Early"s}
 
string name_ {}
 
string label_ {}
 
module_id_t moduleID_ {}
 
string cache_ {}
 
id_label_map_t idLabelMap_ {}
 

Detailed Description

Definition at line 28 of file MessageDrop.cc.

Member Typedef Documentation

Definition at line 31 of file MessageDrop.cc.

Member Function Documentation

void mf::MessageDrop::StringProducerWithPhase::set ( string const &  name,
string const &  label,
module_id_t  moduleID,
string const &  phase 
)
inline

Definition at line 58 of file MessageDrop.cc.

62  {
63  name_ = name;
64  label_ = label;
65  moduleID_ = moduleID;
66  phase_ = "@"s + phase;
67  cache_.clear();
68  }
static const double s
Definition: Units.h:99
virtual string mf::MessageDrop::StringProducerWithPhase::theContext ( ) const
inlineoverridevirtual

Implements mf::MessageDrop::StringProducer.

Definition at line 35 of file MessageDrop.cc.

36  {
37  if (cache_.empty()) {
39  auto nameLableIter = idLabelMap_.find(moduleID_);
40  if (nameLableIter != idLabelMap_.end()) {
41  cache_.assign(nameLableIter->second);
42  cache_.append(phase_);
43  return cache_;
44  }
45  }
46  cache_.assign(name_);
47  cache_.append(":");
48  cache_.append(label_);
50  if (!phase_.empty()) {
51  cache_.append(phase_);
52  }
53  }
54  return cache_;
55  }

Member Data Documentation

string mf::MessageDrop::StringProducerWithPhase::cache_ {}
mutableprivate

Definition at line 79 of file MessageDrop.cc.

id_label_map_t mf::MessageDrop::StringProducerWithPhase::idLabelMap_ {}
mutableprivate

Definition at line 81 of file MessageDrop.cc.

string mf::MessageDrop::StringProducerWithPhase::label_ {}
private

Definition at line 75 of file MessageDrop.cc.

module_id_t mf::MessageDrop::StringProducerWithPhase::moduleID_ {}
private

Definition at line 77 of file MessageDrop.cc.

string mf::MessageDrop::StringProducerWithPhase::name_ {}
private

Definition at line 73 of file MessageDrop.cc.

string mf::MessageDrop::StringProducerWithPhase::phase_ {"@Early"s}
private

Definition at line 71 of file MessageDrop.cc.


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