#include <ConsRegMessage.h>
Public Member Functions | |
uint32 | code () const |
ConsRegResponseView (void *buf) | |
uint32 | getConsumerId () |
uint32 | getStatus () |
std::map< std::string, Strings > | getStreamSelectionTable () |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
uint32 | consumerId_ |
HeaderView | head_ |
uint32 | status_ |
Definition at line 78 of file ConsRegMessage.h.
ConsRegResponseView::ConsRegResponseView | ( | void * | buf | ) |
Constructor for the consumer registration response viewer.
Definition at line 179 of file ConsRegMessage.cc.
References buf_, code(), Header::CONS_REG_RESPONSE, consumerId_, convert32(), Exception, and status_.
: buf_((uint8*)buf),head_(buf) { uint8* bufPtr; // verify that the buffer actually contains a registration response if (this->code() != Header::CONS_REG_RESPONSE) { throw cms::Exception("MessageDecoding","ConsRegResponseView") << "Invalid consumer registration response message code (" << this->code() << "). Should be " << Header::CONS_REG_RESPONSE << "\n"; } // update the buffer pointer to just beyond the header bufPtr = buf_ + sizeof(Header); // decode the status status_ = convert32(bufPtr); bufPtr += sizeof(uint32); // decode the consumer ID consumerId_ = convert32(bufPtr); bufPtr += sizeof(uint32); }
uint32 ConsRegResponseView::code | ( | ) | const [inline] |
Definition at line 83 of file ConsRegMessage.h.
References HeaderView::code(), and head_.
Referenced by ConsRegResponseView().
uint32 ConsRegResponseView::getConsumerId | ( | ) | [inline] |
uint32 ConsRegResponseView::getStatus | ( | void | ) | [inline] |
std::map< std::string, Strings > ConsRegResponseView::getStreamSelectionTable | ( | ) |
Returns the map of trigger selections for each storage manager output stream.
Definition at line 208 of file ConsRegMessage.cc.
References buf_, convert32(), MsgTools::getNames(), size(), and python::StorageManager_cfg::streamLabel.
{ std::map<std::string, Strings> selTable; // check if there is more than just the status code and consumer id if (size() >= (3 * sizeof(uint32))) { // initialize the data pointer to the start of the map data uint8* bufPtr = buf_ + sizeof(Header); bufPtr += (2 * sizeof(uint32)); // decode the number of streams in the table uint32 streamCount = convert32(bufPtr); bufPtr += sizeof(uint32); // loop over each stream for (uint32 idx = 0; idx < streamCount; idx++) { // decode the vector of strings for the stream Strings workList; //uint32 listCount = convert32(bufPtr); bufPtr += sizeof(uint32); uint32 listLen = convert32(bufPtr); bufPtr += sizeof(uint32); MsgTools::getNames(bufPtr, listLen, workList); // pull the map key off the end of the list std::string streamLabel = workList.back(); workList.pop_back(); selTable[streamLabel] = workList; // move on to the next entry in the message bufPtr += listLen; } } return selTable; }
uint32 ConsRegResponseView::size | ( | void | ) | const [inline] |
Definition at line 84 of file ConsRegMessage.h.
References head_, and HeaderView::size().
Referenced by getStreamSelectionTable().
uint8* ConsRegResponseView::startAddress | ( | ) | [inline] |
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.
uint32 ConsRegResponseView::status_ [private] |
Definition at line 94 of file ConsRegMessage.h.
Referenced by ConsRegResponseView(), and getStatus().