#include <ConsRegMessage.h>
Public Types | |
enum | STATUS_CODES { ES_NOT_READY = 0x10000 } |
Public Member Functions | |
uint32 | bufferSize () const |
ConsRegResponseBuilder (void *buf, uint32 bufSize, uint32 status, uint32 consumerId) | |
void | setStreamSelectionTable (std::map< std::string, Strings > const &selTable) |
uint32 | size () const |
uint8 * | startAddress () |
Private Attributes | |
uint8 * | buf_ |
uint32 | bufSize_ |
Definition at line 57 of file ConsRegMessage.h.
Definition at line 69 of file ConsRegMessage.h.
{ ES_NOT_READY = 0x10000 };
ConsRegResponseBuilder::ConsRegResponseBuilder | ( | void * | buf, |
uint32 | bufSize, | ||
uint32 | status, | ||
uint32 | consumerId | ||
) |
Constructor for the consumer registration response builder.
Definition at line 110 of file ConsRegMessage.cc.
References buf_, bufSize_, Header::CONS_REG_RESPONSE, and lhef::cc::convert().
: buf_((uint8*)buf),bufSize_(bufSize) { uint8* bufPtr; // update the buffer pointer to just beyond the header bufPtr = buf_ + sizeof(Header); assert(((uint32) (bufPtr - buf_)) <= bufSize_); // encode the status assert(((uint32) (bufPtr + sizeof(uint32) - buf_)) <= bufSize_); convert (status, bufPtr); bufPtr += sizeof(uint32); // encode the consumer ID assert(((uint32) (bufPtr + sizeof(uint32) - buf_)) <= bufSize_); convert (consumerId, bufPtr); bufPtr += sizeof(uint32); // create the message header now that we now the full size new (buf_) Header(Header::CONS_REG_RESPONSE, (bufPtr - buf_)); }
uint32 ConsRegResponseBuilder::bufferSize | ( | ) | const [inline] |
void ConsRegResponseBuilder::setStreamSelectionTable | ( | std::map< std::string, Strings > const & | selTable | ) |
Sets the stream selection table (map of trigger selections for each storage manager output stream) in the response.
Definition at line 149 of file ConsRegMessage.cc.
References buf_, bufSize_, Header::CONS_REG_RESPONSE, lhef::cc::convert(), MsgTools::fillNames(), and size().
{ // add the table just beyond the existing data uint8* bufPtr = buf_ + size(); // add the number of entries in the table to the message convert (static_cast<uint32>(selTable.size()), bufPtr); bufPtr += sizeof(uint32); assert(((uint32) (bufPtr - buf_)) <= bufSize_); // add each entry in the table to the message std::map<std::string, Strings>::const_iterator mapIter; for (mapIter = selTable.begin(); mapIter != selTable.end(); mapIter++) { // create a new string list with the map key as the last entry Strings workList = mapIter->second; workList.push_back(mapIter->first); // copy the string list into the message bufPtr = MsgTools::fillNames(workList, bufPtr); assert(((uint32) (bufPtr - buf_)) <= bufSize_); } // update the message header with the new full size new (buf_) Header(Header::CONS_REG_RESPONSE, (bufPtr - buf_)); }
uint32 ConsRegResponseBuilder::size | ( | void | ) | const |
Returns the size of the consumer registration response.
Definition at line 138 of file ConsRegMessage.cc.
References buf_, and HeaderView::size().
Referenced by setStreamSelectionTable().
{ HeaderView hview(buf_); return hview.size(); }
uint8* ConsRegResponseBuilder::startAddress | ( | ) | [inline] |
uint8* ConsRegResponseBuilder::buf_ [private] |
Definition at line 72 of file ConsRegMessage.h.
Referenced by ConsRegResponseBuilder(), setStreamSelectionTable(), size(), and startAddress().
uint32 ConsRegResponseBuilder::bufSize_ [private] |
Definition at line 73 of file ConsRegMessage.h.
Referenced by bufferSize(), ConsRegResponseBuilder(), and setStreamSelectionTable().