diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-11-07 12:42:20 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2013-11-13 19:30:18 -0500 |
commit | b98712c551e8ab27c33e1a5e7c694fa36c3334ce (patch) | |
tree | f4d54911a8fb171ff1275896a1d733eac657e2fb /src/mongo/db/field_ref_set.h | |
parent | a87e0ed4ec30725e3ffd7de75c0f204ca0f42b45 (diff) | |
download | mongo-b98712c551e8ab27c33e1a5e7c694fa36c3334ce.tar.gz |
SERVER-11531, SERVER-10489, SERVER-6835, SERVER-4830: Refactor update system to support immutable fields, consolodate storage validation, and misc issues.
Diffstat (limited to 'src/mongo/db/field_ref_set.h')
-rw-r--r-- | src/mongo/db/field_ref_set.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mongo/db/field_ref_set.h b/src/mongo/db/field_ref_set.h index c80e3714e69..71a48502739 100644 --- a/src/mongo/db/field_ref_set.h +++ b/src/mongo/db/field_ref_set.h @@ -31,6 +31,8 @@ #include <set> #include "mongo/base/disallow_copying.h" +#include "mongo/base/owned_pointer_vector.h" +#include "mongo/base/status.h" #include "mongo/db/field_ref.h" namespace mongo { @@ -70,7 +72,7 @@ namespace mongo { /** * Returns true if the field 'toInsert' can be added in the set without - * conflicts. Otwerwise returns false and fill in '*conflict' with the field 'toInsert' + * conflicts. Otherwise returns false and fill in '*conflict' with the field 'toInsert' * clashed with. * * There is no ownership transfer of 'toInsert'. The caller is responsible for @@ -80,6 +82,16 @@ namespace mongo { bool insert(const FieldRef* toInsert, const FieldRef** conflict); /** + * Fills the set with the supplied FieldRef*s + */ + void fillFrom(const std::vector<FieldRef*>& fields); + + /** + * Replace any existing conflicting FieldRef with the shortest (closest to root) one + */ + void keepShortest(const FieldRef* toInsert); + + /** * Find all inserted fields which conflict with the FieldRef 'toCheck' by the semantics * of 'insert', and add those fields to the 'conflicts' set. */ @@ -89,6 +101,11 @@ namespace mongo { _fieldSet.clear(); } + /** + * A debug/log-able string + */ + const std::string toString() const; + private: // A set of field_ref pointers, none of which is owned here. FieldSet _fieldSet; |