CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ConsRegResponseView Class Reference

#include <ConsRegMessage.h>

Public Member Functions

uint32 code () const
 
 ConsRegResponseView (void *buf)
 
uint32 getConsumerId ()
 
uint32 getStatus ()
 
std::map< std::string, StringsgetStreamSelectionTable ()
 
uint32 size () const
 
uint8startAddress ()
 

Private Attributes

uint8buf_
 
uint32 consumerId_
 
HeaderView head_
 
uint32 status_
 

Detailed Description

Definition at line 78 of file ConsRegMessage.h.

Constructor & Destructor Documentation

ConsRegResponseView::ConsRegResponseView ( void *  buf)

Constructor for the consumer registration response viewer.

Definition at line 172 of file ConsRegMessage.cc.

References buf_, code(), Header::CONS_REG_RESPONSE, consumerId_, convert32(), edm::hlt::Exception, and status_.

172  :
173  buf_((uint8*)buf),head_(buf)
174 {
175  // verify that the buffer actually contains a registration response
176  if (this->code() != Header::CONS_REG_RESPONSE)
177  {
178  throw cms::Exception("MessageDecoding","ConsRegResponseView")
179  << "Invalid consumer registration response message code ("
180  << this->code() << "). Should be " << Header::CONS_REG_RESPONSE << "\n";
181  }
182 
183  // update the buffer pointer to just beyond the header
184  uint8* bufPtr = buf_ + sizeof(Header);
185 
186  // decode the status
187  status_ = convert32(bufPtr);
188  bufPtr += sizeof(uint32);
189 
190  // decode the consumer ID
191  consumerId_ = convert32(bufPtr);
192  bufPtr += sizeof(uint32);
193 
194  assert(bufPtr); // silence clang static analyzer
195 }
unsigned int uint32
Definition: MsgTools.h:13
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:30
unsigned char uint8
Definition: MsgTools.h:11
uint32 code() const

Member Function Documentation

uint32 ConsRegResponseView::code ( ) const
inline

Definition at line 83 of file ConsRegMessage.h.

References HeaderView::code(), and head_.

Referenced by ConsRegResponseView().

83 { return head_.code(); }
uint32 code() const
Definition: MsgHeader.h:34
uint32 ConsRegResponseView::getConsumerId ( )
inline

Definition at line 88 of file ConsRegMessage.h.

References consumerId_.

88 { return consumerId_; }
uint32 ConsRegResponseView::getStatus ( void  )
inline

Definition at line 87 of file ConsRegMessage.h.

References status_.

87 { return status_; }
std::map< std::string, Strings > ConsRegResponseView::getStreamSelectionTable ( )

Returns the map of trigger selections for each storage manager output stream.

Definition at line 201 of file ConsRegMessage.cc.

References buf_, convert32(), MsgTools::getNames(), customizeTrackingMonitorSeedNumber::idx, size(), StorageManager_cfg::streamLabel, and AlCaHLTBitMon_QueryRunRegistry::string.

202 {
203  std::map<std::string, Strings> selTable;
204 
205  // check if there is more than just the status code and consumer id
206  if (size() >= (3 * sizeof(uint32)))
207  {
208  // initialize the data pointer to the start of the map data
209  uint8* bufPtr = buf_ + sizeof(Header);
210  bufPtr += (2 * sizeof(uint32));
211 
212  // decode the number of streams in the table
213  uint32 streamCount = convert32(bufPtr);
214  bufPtr += sizeof(uint32);
215 
216  // loop over each stream
217  for (uint32 idx = 0; idx < streamCount; idx++)
218  {
219  // decode the vector of strings for the stream
220  Strings workList;
221  //uint32 listCount = convert32(bufPtr);
222  bufPtr += sizeof(uint32);
223  uint32 listLen = convert32(bufPtr);
224  bufPtr += sizeof(uint32);
225  MsgTools::getNames(bufPtr, listLen, workList);
226 
227  // pull the map key off the end of the list
228  std::string streamLabel = workList.back();
229  workList.pop_back();
230  selTable[streamLabel] = workList;
231 
232  // move on to the next entry in the message
233  bufPtr += listLen;
234  }
235  }
236 
237  return selTable;
238 }
std::vector< std::string > Strings
Definition: MsgTools.h:18
unsigned int uint32
Definition: MsgTools.h:13
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:30
unsigned char uint8
Definition: MsgTools.h:11
void getNames(uint8 *from, uint32 from_len, Strings &to)
Definition: MsgTools.h:91
uint32 size() const
uint32 ConsRegResponseView::size ( void  ) const
inline

Definition at line 84 of file ConsRegMessage.h.

References head_, and HeaderView::size().

Referenced by getStreamSelectionTable().

84 { return head_.size(); }
uint32 size() const
Definition: MsgHeader.h:35
uint8* ConsRegResponseView::startAddress ( )
inline

Definition at line 85 of file ConsRegMessage.h.

References buf_.

85 { return buf_; }

Member Data Documentation

uint8* ConsRegResponseView::buf_
private

Definition at line 92 of file ConsRegMessage.h.

Referenced by ConsRegResponseView(), getStreamSelectionTable(), and startAddress().

uint32 ConsRegResponseView::consumerId_
private

Definition at line 95 of file ConsRegMessage.h.

Referenced by ConsRegResponseView(), and getConsumerId().

HeaderView ConsRegResponseView::head_
private

Definition at line 93 of file ConsRegMessage.h.

Referenced by code(), and size().

uint32 ConsRegResponseView::status_
private

Definition at line 94 of file ConsRegMessage.h.

Referenced by ConsRegResponseView(), and getStatus().