CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
MsgTools Namespace Reference

Functions

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

Function Documentation

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

Definition at line 75 of file MsgTools.h.

References fileCollector::convert(), edm::copy_all(), and plotBeamSpotDB::first.

Referenced by InitMsgBuilder::InitMsgBuilder().

76 {
77  uint32 sz = names.size();
78  convert(sz,pos); // save number of strings
79  uint8* len_pos = pos + sizeof(char_uint32); // area for length
80  pos = len_pos + sizeof(char_uint32); // area for full string of names
81  bool first = true;
82 
83  for(Strings::const_iterator beg = names.begin(); beg != names.end(); ++beg) {
84  if(first) first = false; else *pos++ = ' ';
85  pos = edm::copy_all(*beg,pos);
86  }
87  convert((uint32)(pos-len_pos-sizeof(char_uint32)),len_pos);
88  return pos;
89 }
static const HistoName names[]
unsigned int uint32
Definition: MsgTools.h:13
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
unsigned char uint8
Definition: MsgTools.h:11
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
void MsgTools::getNames ( uint8 from,
uint32  from_len,
Strings to 
)
inline

Definition at line 91 of file MsgTools.h.

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

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

92 {
93  // not the most efficient way to do this
94  std::istringstream ist(std::string(reinterpret_cast<char *>(from),from_len));
95  typedef std::istream_iterator<std::string> Iter;
96  std::copy(Iter(ist),Iter(),std::back_inserter(to));
97 }