diff options
author | Jason Carey (hanumantmk) <jcarey@argv.me> | 2015-03-19 16:37:54 -0400 |
---|---|---|
committer | Jason Carey (hanumantmk) <jcarey@argv.me> | 2015-04-14 14:32:49 -0400 |
commit | 67829601c0e4516f70a59140c8971f5111372b8b (patch) | |
tree | 34a85a1f43b16c5e29d47767315d5dd0d04cbf08 /src/mongo/db/dbmessage.h | |
parent | 8bd99fa7bd4387abeb5f6ddf0907b36f67d9c702 (diff) | |
download | mongo-67829601c0e4516f70a59140c8971f5111372b8b.tar.gz |
SERVER-17629 Implemented Bounded Data View/Cursor
Implements DataRange and DataRangeCursor, bounded Status returning
variants of DataView and DataCursor.
Implements DataType::Handler<> to allow for specialization by type.
* Endian specializations
* BSONObj specialization
Fix for endian conversions for floats and doubles to avoid some
signaling bit patterns.
Diffstat (limited to 'src/mongo/db/dbmessage.h')
-rw-r--r-- | src/mongo/db/dbmessage.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/dbmessage.h b/src/mongo/db/dbmessage.h index 85d4ed731b4..78da93956c2 100644 --- a/src/mongo/db/dbmessage.h +++ b/src/mongo/db/dbmessage.h @@ -116,15 +116,15 @@ namespace mongo { } int64_t getCursorId() const { - return storage().readLE<int64_t>(offsetof(Layout, cursorId)); + return storage().read<LittleEndian<int64_t>>(offsetof(Layout, cursorId)); } int32_t getStartingFrom() const { - return storage().readLE<int32_t>(offsetof(Layout, startingFrom)); + return storage().read<LittleEndian<int32_t>>(offsetof(Layout, startingFrom)); } int32_t getNReturned() const { - return storage().readLE<int32_t>(offsetof(Layout, nReturned)); + return storage().read<LittleEndian<int32_t>>(offsetof(Layout, nReturned)); } const char* data() const { @@ -155,23 +155,23 @@ namespace mongo { } void setCursorId(int64_t value) { - storage().writeLE(value, offsetof(Layout, cursorId)); + storage().write(tagLittleEndian(value), offsetof(Layout, cursorId)); } void setStartingFrom(int32_t value) { - storage().writeLE(value, offsetof(Layout, startingFrom)); + storage().write(tagLittleEndian(value), offsetof(Layout, startingFrom)); } void setNReturned(int32_t value) { - storage().writeLE(value, offsetof(Layout, nReturned)); + storage().write(tagLittleEndian(value), offsetof(Layout, nReturned)); } int32_t getResultFlags() { - return DataView(msgdata().data()).readLE<int32_t>(); + return DataView(msgdata().data()).read<LittleEndian<int32_t>>(); } void setResultFlags(int32_t value) { - DataView(msgdata().data()).writeLE(value); + DataView(msgdata().data()).write(tagLittleEndian(value)); } void setResultFlagsToOk() { @@ -298,7 +298,7 @@ namespace mongo { if ( d.moreJSObjs() ) { fields = d.nextJsObj(); } - queryOptions = DataView(d.msg().header().data()).readLE<int32_t>(); + queryOptions = DataView(d.msg().header().data()).read<LittleEndian<int32_t>>(); } }; |