test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ConsRegRequestBuilder Class Reference

#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
 
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 fileCollector::convert().

18  :
19  buf_((uint8*)buf),bufSize_(bufSize)
20 {
21  // update the buffer pointer to just beyond the header
22  uint8* bufPtr = buf_ + sizeof(Header);
23  //std::cout << "bufPtr = 0x" << hex << ((uint32) bufPtr) << dec << std::endl;
24  //std::cout << "buf_ = 0x" << hex << ((uint32) buf_) << dec << std::endl;
25  //std::cout << "bufSize_ = " << bufSize_ << std::endl;
26  assert(((uint32) (bufPtr - buf_)) <= bufSize_);
27 
28  // copy the consumer name into the message
29  uint32 len = consumerName.length();
30  assert(((uint32) (bufPtr + len + sizeof(uint32) - buf_)) <= bufSize_);
31  convert(len, bufPtr);
32  bufPtr += sizeof(uint32);
33  consumerName.copy((char *) bufPtr, len);
34  bufPtr += len;
35 
36  // copy the request parameter set into the message
37  len = requestParamSet.length();
38  assert(((uint32) (bufPtr + len + sizeof(uint32) - buf_)) <= bufSize_);
39  convert(len, bufPtr);
40  bufPtr += sizeof(uint32);
41  requestParamSet.copy((char *) bufPtr, len);
42  bufPtr += len;
43 
44  // create the message header now that we now the full size
45  //std::cout << "bufPtr = 0x" << hex << ((uint32) bufPtr) << dec << std::endl;
46  //std::cout << "buf_ = 0x" << hex << ((uint32) buf_) << dec << std::endl;
47  new (buf_) Header(Header::CONS_REG_REQUEST, (bufPtr - buf_));
48 }
static int const bufSize
Definition: Guid.cc:24
unsigned int uint32
Definition: MsgTools.h:13
unsigned char uint8
Definition: MsgTools.h:11

Member Function Documentation

uint32 ConsRegRequestBuilder::bufferSize ( ) const
inline

Definition at line 25 of file ConsRegMessage.h.

References bufSize_.

25 { return bufSize_; }
uint32 ConsRegRequestBuilder::size ( void  ) const

Returns the size of the consumer registration request.

Definition at line 53 of file ConsRegMessage.cc.

References buf_, and HeaderView::size().

54 {
55  HeaderView hview(buf_);
56  return hview.size();
57 }
uint8* ConsRegRequestBuilder::startAddress ( )
inline

Definition at line 26 of file ConsRegMessage.h.

References buf_.

26 { return buf_; }

Member Data Documentation

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().