#include <ConsRegMessage.h>
Public Member Functions | |
uint32 | code () const |
ConsRegRequestView (void *buf) | |
std::string | getConsumerName () |
std::string | getConsumerPriority () |
std::string | getRequestParameterSet () |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
std::string | consumerName_ |
std::string | consumerPriority_ |
HeaderView | head_ |
std::string | requestParameterSet_ |
Definition at line 37 of file ConsRegMessage.h.
ConsRegRequestView::ConsRegRequestView | ( | void * | buf | ) |
Constructor for the consumer registration request viewer.
Definition at line 74 of file ConsRegMessage.cc.
References buf_, code(), Header::CONS_REG_REQUEST, consumerName_, consumerPriority_, convert32(), Exception, requestParameterSet_, and size().
: buf_((uint8*)buf),head_(buf) { uint8* bufPtr; uint32 len; // 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 bufPtr = buf_ + sizeof(Header); // determine the consumer name len = convert32(bufPtr); bufPtr += sizeof(uint32); if (len <= 256) // len >= 0, since len is unsigned { consumerName_.append((char *) bufPtr, len); } bufPtr += len; // determine the consumer priority len = convert32(bufPtr); bufPtr += sizeof(uint32); if (len <= 64) // len >= 0, since len is unsigned { consumerPriority_.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; } }
uint32 ConsRegRequestView::code | ( | ) | const [inline] |
Definition at line 42 of file ConsRegMessage.h.
References HeaderView::code(), and head_.
Referenced by ConsRegRequestView().
std::string ConsRegRequestView::getConsumerName | ( | ) | [inline] |
std::string ConsRegRequestView::getConsumerPriority | ( | ) | [inline] |
Definition at line 47 of file ConsRegMessage.h.
References consumerPriority_.
{ return consumerPriority_; }
std::string ConsRegRequestView::getRequestParameterSet | ( | ) | [inline] |
Definition at line 48 of file ConsRegMessage.h.
References requestParameterSet_.
{ return requestParameterSet_; }
uint32 ConsRegRequestView::size | ( | void | ) | const [inline] |
Definition at line 43 of file ConsRegMessage.h.
References head_, and HeaderView::size().
Referenced by ConsRegRequestView().
uint8* ConsRegRequestView::startAddress | ( | ) | [inline] |
uint8* ConsRegRequestView::buf_ [private] |
Definition at line 51 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and startAddress().
std::string ConsRegRequestView::consumerName_ [private] |
Definition at line 53 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getConsumerName().
std::string ConsRegRequestView::consumerPriority_ [private] |
Definition at line 54 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getConsumerPriority().
HeaderView ConsRegRequestView::head_ [private] |
Definition at line 52 of file ConsRegMessage.h.
std::string ConsRegRequestView::requestParameterSet_ [private] |
Definition at line 55 of file ConsRegMessage.h.
Referenced by ConsRegRequestView(), and getRequestParameterSet().