CMS 3D CMS Logo

Functions
MsgTools Namespace Reference

Functions

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

Function Documentation

◆ fillNames()

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

Definition at line 67 of file MsgTools.h.

67  {
68  uint32 sz = names.size();
69  convert(sz, pos); // save number of strings
70  uint8* len_pos = pos + sizeof(char_uint32); // area for length
71  pos = len_pos + sizeof(char_uint32); // area for full string of names
72  bool first = true;
73 
74  for (Strings::const_iterator beg = names.begin(); beg != names.end(); ++beg) {
75  if (first)
76  first = false;
77  else
78  *pos++ = ' ';
79  pos = edm::copy_all(*beg, pos);
80  }
81  convert((uint32)(pos - len_pos - sizeof(char_uint32)), len_pos);
82  return pos;
83  }

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

Referenced by InitMsgBuilder::InitMsgBuilder().

◆ getNames()

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

Definition at line 85 of file MsgTools.h.

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

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

Referenced by HcalSimParametersFromDD::build(), HcalSimParametersFromDD::fillNameVector(), InitMsgView::hltTriggerNames(), InitMsgView::hltTriggerSelections(), and InitMsgView::l1TriggerNames().

edm::copy_all
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:20
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
uint8
unsigned char uint8
Definition: MsgTools.h:11
pos
Definition: PixelAliasList.h:18
to
char_uint32
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
dqmdumpme.first
first
Definition: dqmdumpme.py:55
uint32
unsigned int uint32
Definition: MsgTools.h:13
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
convert
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:42