#include <ConsRegMessage.h>
Public Member Functions | |
uint32 | code () const |
ConsRegRequestView (void *buf) | |
std::string | getConsumerName () |
std::string | getRequestParameterSet () |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
std::string | consumerName_ |
HeaderView | head_ |
std::string | requestParameterSet_ |
Definition at line 36 of file ConsRegMessage.h.
ConsRegRequestView::ConsRegRequestView | ( | void * | buf | ) |
Constructor for the consumer registration request viewer.
Definition at line 62 of file ConsRegMessage.cc.
References buf_, code(), Header::CONS_REG_REQUEST, consumerName_, convert32(), Exception, requestParameterSet_, and size().
: buf_((uint8*)buf),head_(buf) { // verify that the buffer actually contains a registration request if (this->code() != Header::CONS_REG_REQUEST) { throw cms::Exception("MessageDecoding","ConsRegRequestView") << "Invalid consumer registration request message code (" << this->code() << "). Should be " << Header::CONS_REG_REQUEST << "\n"; } // update the buffer pointer to just beyond the header uint8* bufPtr = buf_ + sizeof(Header); // determine the consumer name uint32 len = convert32(bufPtr); bufPtr += sizeof(uint32); if (len <= 256) // len >= 0, since len is unsigned { consumerName_.append((char *) bufPtr, len); } bufPtr += len; // determine the request parameter set (maintain backward compatibility // with sources of registration requests that don't have the param set) if (bufPtr < (buf_ + this->size())) { len = convert32(bufPtr); bufPtr += sizeof(uint32); // what is a reasonable limit? This is just to prevent // a bogus, really large value from being used... if (len <= 65000) // len >= 0, since len is unsigned { requestParameterSet_.append((char *) bufPtr, len); } bufPtr += len; assert(bufPtr); // silence clang static analyzer } }
uint32 ConsRegRequestView::code | ( | ) | const [inline] |
Definition at line 41 of file ConsRegMessage.h.
References HeaderView::code(), and head_.
Referenced by ConsRegRequestView().
std::string ConsRegRequestView::getConsumerName | ( | ) | [inline] |
std::string ConsRegRequestView::getRequestParameterSet | ( | ) | [inline] |
Definition at line 46 of file ConsRegMessage.h.
References requestParameterSet_.
{ return requestParameterSet_; }
uint32 ConsRegRequestView::size | ( | void | ) | const [inline] |
Definition at line 42 of file ConsRegMessage.h.
References head_, and HeaderView::size().
Referenced by ConsRegRequestView().
uint8* ConsRegRequestView::startAddress | ( | ) | [inline] |
uint8* ConsRegRequestView::buf_ [private] |
Definition at line 49 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and startAddress().
std::string ConsRegRequestView::consumerName_ [private] |
Definition at line 51 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getConsumerName().
HeaderView ConsRegRequestView::head_ [private] |
Definition at line 50 of file ConsRegMessage.h.
std::string ConsRegRequestView::requestParameterSet_ [private] |
Definition at line 52 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getRequestParameterSet().