diff options
author | Raymond Jacobson <raymond.jacobson@10gen.com> | 2015-07-31 16:22:25 -0400 |
---|---|---|
committer | Raymond Jacobson <raymond.jacobson@10gen.com> | 2015-08-07 00:06:34 -0400 |
commit | 2174be1681377e745baafa958c205ab02c1fd657 (patch) | |
tree | 1897a4196f412f842303654ce06845061e441345 /src/mongo/bson/util/builder.h | |
parent | bca1ffecf68cc6e4c929c23f0b3dc9aa682ca96f (diff) | |
download | mongo-2174be1681377e745baafa958c205ab02c1fd657.tar.gz |
SERVER-19624 Add Decimal128 type support to mongo/bson layer
Diffstat (limited to 'src/mongo/bson/util/builder.h')
-rw-r--r-- | src/mongo/bson/util/builder.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/bson/util/builder.h b/src/mongo/bson/util/builder.h index 89c726b38d4..f4248efbe84 100644 --- a/src/mongo/bson/util/builder.h +++ b/src/mongo/bson/util/builder.h @@ -40,6 +40,7 @@ #include "mongo/base/data_view.h" #include "mongo/base/string_data.h" #include "mongo/bson/inline_decls.h" +#include "mongo/platform/decimal128.h" #include "mongo/util/allocator.h" #include "mongo/util/assert_util.h" @@ -52,8 +53,6 @@ namespace mongo { struct PackedDouble { double d; } PACKED_DECL; - - /* Note the limit here is rather arbitrary and is simply a standard. generally the code works with any object that fits in ram. @@ -220,6 +219,10 @@ public: void appendNum(unsigned long long j) { appendNumImpl(j); } + void appendNum(Decimal128 j) { + BOOST_STATIC_ASSERT(sizeof(Decimal128::Value) == 16); + appendNumImpl(j.getValue()); + } void appendBuf(const void* src, size_t len) { memcpy(grow((int)len), src, len); @@ -290,8 +293,6 @@ private: // we bake that assumption in here. This decision should be revisited soon. DataView(grow(sizeof(t))).write(tagLittleEndian(t)); } - - /* "slow" portion of 'grow()' */ void NOINLINE_DECL grow_reallocate(int minSize) { int a = 64; |