CMS 3D CMS Logo

Public Member Functions | Private Attributes

ConsRegRequestBuilder Class Reference

#include <ConsRegMessage.h>

List of all members.

Public Member Functions

uint32 bufferSize () const
 ConsRegRequestBuilder (void *buf, uint32 bufSize, std::string const &consumerName, std::string const &requestParameterSet)
uint32 size () const
uint8startAddress ()

Private Attributes

uint8buf_
uint32 bufSize_

Detailed Description

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.


Constructor & Destructor Documentation

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_));
}

Member Function Documentation

uint32 ConsRegRequestBuilder::bufferSize ( ) const [inline]

Definition at line 25 of file ConsRegMessage.h.

References bufSize_.

{ return bufSize_; }
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]

Definition at line 26 of file ConsRegMessage.h.

References buf_.

{ return buf_; }

Member Data Documentation

Definition at line 30 of file ConsRegMessage.h.

Referenced by ConsRegRequestBuilder(), size(), and startAddress().

Definition at line 31 of file ConsRegMessage.h.

Referenced by bufferSize(), and ConsRegRequestBuilder().