diff options
author | Eliot Horowitz <eliot@10gen.com> | 2013-05-30 11:57:22 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2013-05-30 11:57:22 -0400 |
commit | 29623818ca553d7231a8eb7274ffb16f233670e8 (patch) | |
tree | 41ac2383ee2ec89f7311757e8c15365db2ff699f /src/mongo/db/matcher/matchable.h | |
parent | a6d055026c3a13b423e099e9d080256ac040f706 (diff) | |
download | mongo-29623818ca553d7231a8eb7274ffb16f233670e8.tar.gz |
SERVER-9820: Introduce Path and iterators such that all bson walking logic is one place
Diffstat (limited to 'src/mongo/db/matcher/matchable.h')
-rw-r--r-- | src/mongo/db/matcher/matchable.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/mongo/db/matcher/matchable.h b/src/mongo/db/matcher/matchable.h index 4b93331899e..c980bc2749e 100644 --- a/src/mongo/db/matcher/matchable.h +++ b/src/mongo/db/matcher/matchable.h @@ -20,6 +20,7 @@ #include "mongo/bson/bsonobj.h" #include "mongo/db/field_ref.h" +#include "mongo/db/matcher/path.h" namespace mongo { @@ -29,13 +30,7 @@ namespace mongo { virtual BSONObj toBSON() const = 0; - virtual BSONElement getFieldDottedOrArray( const FieldRef& path, - size_t* idxPath, - bool* inArray ) const = 0; - - virtual void getFieldsDotted( const StringData& name, - BSONElementSet &ret, - bool expandLastArray = true ) const = 0; + virtual ElementIterator* getIterator( const ElementPath& path ) const = 0; }; @@ -46,13 +41,9 @@ namespace mongo { virtual BSONObj toBSON() const { return _obj; } - virtual BSONElement getFieldDottedOrArray( const FieldRef& path, - size_t* idxPath, - bool* inArray ) const; - - virtual void getFieldsDotted( const StringData& name, - BSONElementSet &ret, - bool expandLastArray = true ) const; + virtual ElementIterator* getIterator( const ElementPath& path ) const { + return new BSONElementIterator( path, _obj ); + } private: BSONObj _obj; |