Skip to content

Commit

Permalink
SERVER-6400: remove MatchCategory concept
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed May 9, 2013
1 parent f965a97 commit 0ee3411
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/mongo/db/matcher/expression.cpp
Expand Up @@ -25,8 +25,8 @@

namespace mongo {

MatchExpression::MatchExpression( MatchCategory category, MatchType type )
: _matchCategory( category ), _matchType( type ){
MatchExpression::MatchExpression( MatchType type )
: _matchType( type ){
}


Expand Down
10 changes: 2 additions & 8 deletions src/mongo/db/matcher/expression.h
Expand Up @@ -48,11 +48,7 @@ namespace mongo {
ATOMIC
};

enum MatchCategory {
LEAF, ARRAY, TREE, TYPE_CATEGORY, SPECIAL
};

MatchExpression( MatchCategory category, MatchType type );
MatchExpression( MatchType type );
virtual ~MatchExpression(){}

/**
Expand All @@ -73,7 +69,6 @@ namespace mongo {
virtual const MatchExpression* getChild( size_t i ) const { return NULL; }

MatchType matchType() const { return _matchType; }
MatchCategory matchCategory() const { return _matchCategory; }

virtual string toString() const;
virtual void debugString( StringBuilder& debug, int level = 0 ) const = 0;
Expand All @@ -83,7 +78,6 @@ namespace mongo {
void _debugAddSpace( StringBuilder& debug, int level ) const;

private:
MatchCategory _matchCategory;
MatchType _matchType;
};

Expand All @@ -93,7 +87,7 @@ namespace mongo {
*/
class AtomicMatchExpression : public MatchExpression {
public:
AtomicMatchExpression() : MatchExpression( SPECIAL, ATOMIC ){}
AtomicMatchExpression() : MatchExpression( ATOMIC ){}

virtual bool matches( const MatchableDocument* doc, MatchDetails* details = 0 ) const {
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/mongo/db/matcher/expression_array.h
Expand Up @@ -42,7 +42,7 @@ namespace mongo {
*/
class AllMatchExpression : public MatchExpression {
public:
AllMatchExpression() : MatchExpression( ARRAY, ALL ){}
AllMatchExpression() : MatchExpression( ALL ){}
Status init( const StringData& path );
ArrayFilterEntries* getArrayFilterEntries() { return &_arrayEntries; }

Expand All @@ -65,7 +65,7 @@ namespace mongo {

class ArrayMatchingMatchExpression : public MatchExpression {
public:
ArrayMatchingMatchExpression( MatchType matchType ) : MatchExpression( ARRAY, matchType ){}
ArrayMatchingMatchExpression( MatchType matchType ) : MatchExpression( matchType ){}
virtual ~ArrayMatchingMatchExpression(){}

virtual bool matches( const MatchableDocument* doc, MatchDetails* details ) const;
Expand Down Expand Up @@ -128,7 +128,7 @@ namespace mongo {
*/
class AllElemMatchOp : public MatchExpression {
public:
AllElemMatchOp() : MatchExpression( ARRAY, ALL ){}
AllElemMatchOp() : MatchExpression( ALL ){}
virtual ~AllElemMatchOp();

Status init( const StringData& path );
Expand Down
4 changes: 2 additions & 2 deletions src/mongo/db/matcher/expression_leaf.h
Expand Up @@ -30,7 +30,7 @@ namespace mongo {

class LeafMatchExpression : public MatchExpression {
public:
LeafMatchExpression( MatchType matchType ) : MatchExpression( LEAF, matchType ) {
LeafMatchExpression( MatchType matchType ) : MatchExpression( matchType ) {
_allHaveToMatch = false;
}

Expand Down Expand Up @@ -225,7 +225,7 @@ namespace mongo {

class TypeMatchExpression : public MatchExpression {
public:
TypeMatchExpression() : MatchExpression( TYPE_CATEGORY, TYPE_OPERATOR ){}
TypeMatchExpression() : MatchExpression( TYPE_OPERATOR ){}

Status init( const StringData& path, int type );

Expand Down
4 changes: 2 additions & 2 deletions src/mongo/db/matcher/expression_tree.h
Expand Up @@ -30,7 +30,7 @@ namespace mongo {

class ListOfMatchExpression : public MatchExpression {
public:
ListOfMatchExpression( MatchType type ) : MatchExpression( TREE, type ){}
ListOfMatchExpression( MatchType type ) : MatchExpression( type ){}
virtual ~ListOfMatchExpression();

/**
Expand Down Expand Up @@ -91,7 +91,7 @@ namespace mongo {

class NotMatchExpression : public MatchExpression {
public:
NotMatchExpression() : MatchExpression( TREE, NOT ){}
NotMatchExpression() : MatchExpression( NOT ){}
/**
* @param exp - I own it, and will delete
*/
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/matcher/expression_where.cpp
Expand Up @@ -29,7 +29,7 @@ namespace mongo {

class WhereMatchExpression : public MatchExpression {
public:
WhereMatchExpression() : MatchExpression( SPECIAL, WHERE ){ _func = 0; }
WhereMatchExpression() : MatchExpression( WHERE ){ _func = 0; }
virtual ~WhereMatchExpression(){}

Status init( const StringData& ns, const StringData& theCode, const BSONObj& scope );
Expand Down

0 comments on commit 0ee3411

Please sign in to comment.