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

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

Definition at line 67 of file MsgTools.h.

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

Referenced by InitMsgBuilder::InitMsgBuilder().

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  }
const std::string names[nVars_]
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:42
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:20
void MsgTools::getNames ( uint8 from,
uint32  from_len,
Strings to 
)
inline

Definition at line 85 of file MsgTools.h.

References popcon2dropbox::copy(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

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  }
def copy(args, dbName)