#include <ConsRegMessage.h>
Public Member Functions | |
uint32 | bufferSize () const |
ConsRegRequestBuilder (void *buf, uint32 bufSize, std::string const &consumerName, std::string const &requestParameterSet) | |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
uint32 | bufSize_ |
These classes are used to build and view the registration requests and replies that are exchanged between individual event consumers and the event server.
15-Aug-2006 - KAB - Initial Implementation
Definition at line 18 of file ConsRegMessage.h.
ConsRegRequestBuilder::ConsRegRequestBuilder | ( | void * | buf, |
uint32 | bufSize, | ||
std::string const & | consumerName, | ||
std::string const & | requestParamSet | ||
) |
These classes are used to build and view the registration requests and replies that are exchanged between individual event consumers and the event server.
15-Aug-2006 - KAB - Initial Implementation Constructor for the consumer registration request builder.
Definition at line 16 of file ConsRegMessage.cc.
References buf_, bufSize_, Header::CONS_REG_REQUEST, and lhef::cc::convert().
: buf_((uint8*)buf),bufSize_(bufSize) { uint8* bufPtr; uint32 len; // update the buffer pointer to just beyond the header bufPtr = buf_ + sizeof(Header); //std::cout << "bufPtr = 0x" << hex << ((uint32) bufPtr) << dec << std::endl; //std::cout << "buf_ = 0x" << hex << ((uint32) buf_) << dec << std::endl; //std::cout << "bufSize_ = " << bufSize_ << std::endl; assert(((uint32) (bufPtr - buf_)) <= bufSize_); // copy the consumer name into the message len = consumerName.length(); assert(((uint32) (bufPtr + len + sizeof(uint32) - buf_)) <= bufSize_); convert(len, bufPtr); bufPtr += sizeof(uint32); consumerName.copy((char *) bufPtr, len); bufPtr += len; // copy the request parameter set into the message len = requestParamSet.length(); assert(((uint32) (bufPtr + len + sizeof(uint32) - buf_)) <= bufSize_); convert(len, bufPtr); bufPtr += sizeof(uint32); requestParamSet.copy((char *) bufPtr, len); bufPtr += len; // create the message header now that we now the full size //std::cout << "bufPtr = 0x" << hex << ((uint32) bufPtr) << dec << std::endl; //std::cout << "buf_ = 0x" << hex << ((uint32) buf_) << dec << std::endl; new (buf_) Header(Header::CONS_REG_REQUEST, (bufPtr - buf_)); }
uint32 ConsRegRequestBuilder::bufferSize | ( | ) | const [inline] |
uint32 ConsRegRequestBuilder::size | ( | void | ) | const |
Returns the size of the consumer registration request.
Definition at line 56 of file ConsRegMessage.cc.
References buf_, and HeaderView::size().
{ HeaderView hview(buf_); return hview.size(); }
uint8* ConsRegRequestBuilder::startAddress | ( | ) | [inline] |
uint8* ConsRegRequestBuilder::buf_ [private] |
Definition at line 30 of file ConsRegMessage.h.
Referenced by ConsRegRequestBuilder(), size(), and startAddress().
uint32 ConsRegRequestBuilder::bufSize_ [private] |
Definition at line 31 of file ConsRegMessage.h.
Referenced by bufferSize(), and ConsRegRequestBuilder().