CMS 3D CMS Logo

ConsRegResponseView Class Reference

#include <IOPool/Streamer/interface/ConsRegMessage.h>

List of all members.

Public Member Functions

uint32 code () const
 ConsRegResponseView (void *buf)
 Constructor for the consumer registration response viewer.
uint32 getConsumerId ()
uint32 getStatus ()
std::map< std::string, StringsgetStreamSelectionTable ()
 Returns the map of trigger selections for each storage manager output stream.
uint32 size () const
uint8startAddress ()

Private Attributes

uint8buf_
uint32 consumerId_
HeaderView head_
uint32 status_


Detailed Description

Definition at line 81 of file ConsRegMessage.h.


Constructor & Destructor Documentation

ConsRegResponseView::ConsRegResponseView ( void buf  ) 

Constructor for the consumer registration response viewer.

Definition at line 206 of file ConsRegMessage.cc.

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

00206                                                  :
00207   buf_((uint8*)buf),head_(buf)
00208 {
00209   uint8* bufPtr;
00210 
00211   // verify that the buffer actually contains a registration response
00212   if (this->code() != Header::CONS_REG_RESPONSE)
00213     {
00214       throw cms::Exception("MessageDecoding","ConsRegResponseView")
00215         << "Invalid consumer registration response message code ("
00216         << this->code() << "). Should be " << Header::CONS_REG_RESPONSE << "\n";
00217     }
00218 
00219   // update the buffer pointer to just beyond the header
00220   bufPtr = buf_ + sizeof(Header);
00221 
00222   // decode the status
00223   status_ = convert32(bufPtr);
00224   bufPtr += sizeof(uint32);
00225 
00226   // decode the consumer ID
00227   consumerId_ = convert32(bufPtr);
00228   bufPtr += sizeof(uint32);
00229 }


Member Function Documentation

uint32 ConsRegResponseView::code ( void   )  const [inline]

Definition at line 86 of file ConsRegMessage.h.

References HeaderView::code(), and head_.

Referenced by ConsRegResponseView().

00086 { return head_.code(); }

uint32 ConsRegResponseView::getConsumerId (  )  [inline]

Definition at line 91 of file ConsRegMessage.h.

References consumerId_.

00091 { return consumerId_; }

uint32 ConsRegResponseView::getStatus ( void   )  [inline]

Definition at line 90 of file ConsRegMessage.h.

References status_.

00090 { return status_; }

std::map< std::string, Strings > ConsRegResponseView::getStreamSelectionTable (  ) 

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

Definition at line 235 of file ConsRegMessage.cc.

References buf_, convert32(), MsgTools::getNames(), size(), and python::StorageManager_cfg::streamLabel.

00236 {
00237   std::map<std::string, Strings> selTable;
00238 
00239   // check if there is more than just the status code and consumer id
00240   if (size() >= (3 * sizeof(uint32)))
00241     {
00242       // initialize the data pointer to the start of the map data
00243       uint8* bufPtr = buf_ + sizeof(Header);
00244       bufPtr += (2 * sizeof(uint32));
00245 
00246       // decode the number of streams in the table
00247       uint32 streamCount = convert32(bufPtr);
00248       bufPtr += sizeof(uint32);
00249 
00250       // loop over each stream
00251       for (uint32 idx = 0; idx < streamCount; idx++)
00252         {
00253           // decode the vector of strings for the stream
00254           Strings workList;
00255           //uint32 listCount = convert32(bufPtr);
00256           bufPtr += sizeof(uint32);
00257           uint32 listLen = convert32(bufPtr);
00258           bufPtr += sizeof(uint32);
00259           MsgTools::getNames(bufPtr, listLen, workList);
00260 
00261           // pull the map key off the end of the list 
00262           std::string streamLabel = workList.back();
00263           workList.pop_back();
00264           selTable[streamLabel] = workList;
00265 
00266           // move on to the next entry in the message
00267           bufPtr += listLen;
00268         }
00269     }
00270 
00271   return selTable;
00272 }

uint32 ConsRegResponseView::size ( void   )  const [inline]

Definition at line 87 of file ConsRegMessage.h.

References head_, and HeaderView::size().

Referenced by stor::SMProxyServer::consumerWebPage(), stor::StorageManager::consumerWebPage(), stor::StorageManager::DQMconsumerWebPage(), stor::SMProxyServer::DQMconsumerWebPage(), and getStreamSelectionTable().

00087 { return head_.size(); }

uint8* ConsRegResponseView::startAddress (  )  [inline]

Definition at line 88 of file ConsRegMessage.h.

References buf_.

00088 { return buf_; }


Member Data Documentation

uint8* ConsRegResponseView::buf_ [private]

Definition at line 95 of file ConsRegMessage.h.

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

uint32 ConsRegResponseView::consumerId_ [private]

Definition at line 98 of file ConsRegMessage.h.

Referenced by ConsRegResponseView(), and getConsumerId().

HeaderView ConsRegResponseView::head_ [private]

Definition at line 96 of file ConsRegMessage.h.

Referenced by code(), and size().

uint32 ConsRegResponseView::status_ [private]

Definition at line 97 of file ConsRegMessage.h.

Referenced by ConsRegResponseView(), and getStatus().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:47 2009 for CMSSW by  doxygen 1.5.4