CMS 3D CMS Logo

Functions
edm::streamer::MsgTools Namespace Reference

Functions

uint8fillNames (const Strings &names, uint8 *pos)
 
void getNames (uint8 *from, uint32 from_len, Strings &to)
 

Function Documentation

◆ fillNames()

uint8* edm::streamer::MsgTools::fillNames ( const Strings names,
uint8 pos 
)
inline

Definition at line 68 of file MsgTools.h.

References edm::streamer::convert(), edm::copy_all(), edm::first(), and names.

Referenced by edm::streamer::InitMsgBuilder::InitMsgBuilder().

68  {
69  uint32 sz = names.size();
70  convert(sz, pos); // save number of strings
71  uint8* len_pos = pos + sizeof(char_uint32); // area for length
72  pos = len_pos + sizeof(char_uint32); // area for full string of names
73  bool first = true;
74 
75  for (Strings::const_iterator beg = names.begin(); beg != names.end(); ++beg) {
76  if (first)
77  first = false;
78  else
79  *pos++ = ' ';
80  pos = edm::copy_all(*beg, pos);
81  }
82  convert((uint32)(pos - len_pos - sizeof(char_uint32)), len_pos);
83  return pos;
84  }
const std::string names[nVars_]
unsigned char uint8
Definition: MsgTools.h:12
W convert(V v)
Definition: ExtVec.h:66
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:20
unsigned int uint32
Definition: MsgTools.h:14

◆ getNames()

void edm::streamer::MsgTools::getNames ( uint8 from,
uint32  from_len,
Strings to 
)
inline

Definition at line 86 of file MsgTools.h.

References filterCSVwithJSON::copy, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MaterialBudgetHcalProducer::beginRun(), HcalSimParametersFromDD::build(), MaterialBudgetHcalHistos::fillBeginJob(), HcalSimParametersFromDD::fillNameVector(), edm::streamer::InitMsgView::hltTriggerNames(), edm::streamer::InitMsgView::hltTriggerSelections(), and edm::streamer::InitMsgView::l1TriggerNames().

86  {
87  // not the most efficient way to do this
88  std::istringstream ist(std::string(reinterpret_cast<char*>(from), from_len));
89  typedef std::istream_iterator<std::string> Iter;
90  std::copy(Iter(ist), Iter(), std::back_inserter(to));
91  }