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

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

References buf_, and HeaderView::size().

57 {
58  HeaderView hview(buf_);
59  return hview.size();
60 }
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().