diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-06-07 15:24:18 +0300 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-06-08 08:17:25 +0300 |
commit | b2d6f747eb85d303d309f5990ba395eb9a23fa86 (patch) | |
tree | 834e5daa51d1f1e70ed3c3da4c027f3b179a7297 /src/mongo/db/field_parser.h | |
parent | 2179beff8f248ce78d2ce5e7952c8c74691c8afc (diff) | |
download | mongo-b2d6f747eb85d303d309f5990ba395eb9a23fa86.tar.gz |
SERVER-29464 Get rid of BSONSerializable
Diffstat (limited to 'src/mongo/db/field_parser.h')
-rw-r--r-- | src/mongo/db/field_parser.h | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/src/mongo/db/field_parser.h b/src/mongo/db/field_parser.h index 376bd66f561..20840c57f2a 100644 --- a/src/mongo/db/field_parser.h +++ b/src/mongo/db/field_parser.h @@ -216,12 +216,9 @@ public: // TODO: BSONElement extraction of types below /** - * Extracts a mandatory BSONSerializable structure 'field' from the object 'doc'. Write - * the extracted contents to '*out' if successful or fills '*errMsg', if exising, - * otherwise. This variant relies on T having a parseBSON, which all - * BSONSerializable's have. - * - * TODO: Tighten for BSONSerializable's only + * Extracts a mandatory 'field' from the object 'doc'. Writes the extracted contents to '*out' + * if successful or fills '*errMsg', if exising, otherwise. This variant relies on T having a + * parseBSON method. */ template <typename T> static FieldState extract(BSONObj doc, @@ -229,19 +226,17 @@ public: T* out, std::string* errMsg = NULL); + /** + * Similar to the mandatory 'extract' but on a optional field. The '*out' value would only be + * allocated if the field is present. The ownership of '*out' would be transferred to the + * caller, in that case. + */ template <typename T> static FieldState extract(BSONObj doc, const BSONField<T*>& field, T** out, std::string* errMsg = NULL); - /** - * Similar to the mandatory 'extract' but on a optional field. '*out' would only be - * allocated if the field is present. The ownership of '*out' would be transferred to - * the caller, in that case. - * - * TODO: Tighten for BSONSerializable's only - */ template <typename T> static FieldState extract(BSONObj doc, const BSONField<T>& field, @@ -249,14 +244,11 @@ public: std::string* errMsg = NULL); /** - * Extracts a mandatory repetition of BSONSerializable structures, 'field', from the - * object 'doc'. Write the extracted contents to '*out' if successful or fills - * '*errMsg', if exising, otherwise. This variant relies on T having a parseBSON, - * which all BSONSerializable's have. + * Extracts a mandatory repetition of 'field', from the object 'doc'. Writes the extracted + * contents to '*out' if successful or fills '*errMsg', if exising, otherwise. This variant + * relies on T having a parseBSON method. * * The vector owns the instances of T. - * - * TODO: Tighten for BSONSerializable's only */ template <typename T> static FieldState extract(BSONObj doc, @@ -265,14 +257,11 @@ public: std::string* errMsg = NULL); /** - * Extracts a mandatory repetition of BSONSerializable structures, 'field', from the - * field 'elem'. Write the extracted contents to '*out' if successful or fills - * '*errMsg', if exising, otherwise. This variant relies on T having a parseBSON, - * which all BSONSerializable's have. + * Extracts a mandatory repetition of 'field', from the field 'elem'. Writes the extracted + * contents to '*out' if successful or fills '*errMsg', if exising, otherwise. This variant + * relies on T having a parseBSON method. * * The vector owns the instances of T. - * - * TODO: Tighten for BSONSerializable's only */ template <typename T> static FieldState extract(BSONElement elem, @@ -281,13 +270,11 @@ public: std::string* errMsg = NULL); /** - * Similar to the mandatory repetition' extract but on an optional field. '*out' would - * only be allocated if the field is present. The ownership of '*out' would be - * transferred to the caller, in that case. + * Similar to the mandatory repetition' extract but on an optional field. The '*out' value would + * only be allocated if the field is present. The ownership of '*out' would be transferred to + * the caller, in that case. * * The vector owns the instances of T. - * - * TODO: Tighten for BSONSerializable's only */ template <typename T> static FieldState extract(BSONObj doc, |