mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 15:19:21 +01:00
VS 71,80,90 projects, style edits
This commit is contained in:
@@ -35,17 +35,21 @@
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#ifndef _MongoDB_MessageHeader_included
|
||||
#define _MongoDB_MessageHeader_included
|
||||
#ifndef MongoDB_MessageHeader_INCLUDED
|
||||
#define MongoDB_MessageHeader_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/MongoDB/MongoDB.h"
|
||||
#include "Poco/MongoDB/MessageHeader.h"
|
||||
|
||||
|
||||
#define MSG_HEADER_SIZE 16
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace MongoDB {
|
||||
|
||||
|
||||
class MongoDB_API MessageHeader
|
||||
/// Represents the header which is always prepended to a request
|
||||
/// or response of MongoDB
|
||||
@@ -63,60 +67,42 @@ public:
|
||||
, KillCursors = 2007
|
||||
} OpCode;
|
||||
|
||||
|
||||
virtual ~MessageHeader();
|
||||
/// Destructor
|
||||
|
||||
|
||||
void read(BinaryReader& reader);
|
||||
/// Reads the header
|
||||
|
||||
|
||||
void write(BinaryWriter& writer);
|
||||
/// Writes the header
|
||||
|
||||
|
||||
Int32 getMessageLength() const;
|
||||
/// Returns the message length
|
||||
|
||||
|
||||
OpCode opCode() const;
|
||||
/// Returns the OpCode
|
||||
|
||||
|
||||
Int32 getRequestID() const;
|
||||
/// Returns the request id of the current message
|
||||
|
||||
|
||||
void setRequestID(Int32 id);
|
||||
/// Sets the request id of the current message
|
||||
|
||||
|
||||
Int32 responseTo() const;
|
||||
/// Returns the request id from the original request.
|
||||
|
||||
private:
|
||||
|
||||
MessageHeader(OpCode opcode);
|
||||
/// Constructor.
|
||||
|
||||
|
||||
Int32 _messageLength;
|
||||
|
||||
|
||||
void setMessageLength(Int32 length);
|
||||
/// Sets the message length
|
||||
|
||||
|
||||
Int32 _messageLength;
|
||||
Int32 _requestID;
|
||||
|
||||
|
||||
Int32 _responseTo;
|
||||
|
||||
|
||||
OpCode _opCode;
|
||||
|
||||
|
||||
friend class Message;
|
||||
};
|
||||
|
||||
@@ -126,21 +112,25 @@ inline MessageHeader::OpCode MessageHeader::opCode() const
|
||||
return _opCode;
|
||||
}
|
||||
|
||||
|
||||
inline Int32 MessageHeader::getMessageLength() const
|
||||
{
|
||||
return _messageLength;
|
||||
}
|
||||
|
||||
|
||||
inline void MessageHeader::setMessageLength(Int32 length)
|
||||
{
|
||||
_messageLength = MSG_HEADER_SIZE + length;
|
||||
}
|
||||
|
||||
|
||||
inline void MessageHeader::setRequestID(Int32 id)
|
||||
{
|
||||
_requestID = id;
|
||||
}
|
||||
|
||||
|
||||
inline Int32 MessageHeader::getRequestID() const
|
||||
{
|
||||
return _requestID;
|
||||
@@ -152,6 +142,7 @@ inline Int32 MessageHeader::responseTo() const
|
||||
}
|
||||
|
||||
|
||||
}} // Namespace Poco::MongoDB
|
||||
} } // namespace Poco::MongoDB
|
||||
|
||||
#endif //_MongoDB_MessageHeader_included
|
||||
|
||||
#endif //MongoDB_MessageHeader_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user