Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/MessageHeader.h
Represents the header which is always prepended to a request or response of MongoDB
Member Functions: getMessageLength, getRequestID, opCode, read, responseTo, setRequestID, write
typedef enum { Reply = 1, Msg = 1000, Update = 2001, Insert = 2002, Query = 2004, GetMore = 2005, Delete = 2006, KillCursors = 2007 } OpCode;
virtual ~MessageHeader();
Destructor
Int32 getMessageLength() const;
Returns the message length
Int32 getRequestID() const;
Returns the request id of the current message
OpCode opCode() const;
Returns the OpCode
void read(
BinaryReader & reader
);
Reads the header
Int32 responseTo() const;
Returns the request id from the original request.
void setRequestID(
Int32 id
);
Sets the request id of the current message
void write(
BinaryWriter & writer
);
Writes the header
static const unsigned int MSG_HEADER_SIZE = 16;