#include <IOPool/Streamer/interface/ConsRegMessage.h>
Public Member Functions | |
uint32 | code () const |
ConsRegResponseView (void *buf) | |
Constructor for the consumer registration response viewer. | |
uint32 | getConsumerId () |
uint32 | getStatus () |
std::map< std::string, Strings > | getStreamSelectionTable () |
Returns the map of trigger selections for each storage manager output stream. | |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
uint32 | consumerId_ |
HeaderView | head_ |
uint32 | status_ |
Definition at line 81 of file ConsRegMessage.h.
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 }
Definition at line 86 of file ConsRegMessage.h.
References HeaderView::code(), and head_.
Referenced by ConsRegResponseView().
uint32 ConsRegResponseView::getConsumerId | ( | ) | [inline] |
Definition at line 91 of file ConsRegMessage.h.
References consumerId_.
00091 { return consumerId_; }
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 }
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().
uint8* ConsRegResponseView::startAddress | ( | ) | [inline] |
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] |
uint32 ConsRegResponseView::status_ [private] |
Definition at line 97 of file ConsRegMessage.h.
Referenced by ConsRegResponseView(), and getStatus().