summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_geo.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-05-06 11:22:54 -0400
committerEliot Horowitz <eliot@10gen.com>2013-05-06 11:22:54 -0400
commited3efe444510137cc45e11188e23680656e22ead (patch)
treedc1d75a66e0f7bb1112adccde2994957845a6f76 /src/mongo/db/matcher/expression_geo.h
parentd6a2d8027f1cbc684d960b8f522e3ffb4043d6d2 (diff)
downloadmongo-ed3efe444510137cc45e11188e23680656e22ead.tar.gz
SERVER-6400: MatchExpression version of Matcher code complete.
Diffstat (limited to 'src/mongo/db/matcher/expression_geo.h')
-rw-r--r--src/mongo/db/matcher/expression_geo.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_geo.h b/src/mongo/db/matcher/expression_geo.h
new file mode 100644
index 00000000000..9808519c586
--- /dev/null
+++ b/src/mongo/db/matcher/expression_geo.h
@@ -0,0 +1,47 @@
+// expression_geo.h
+
+/**
+ * Copyright (C) 2013 10gen Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#pragma once
+
+#include "mongo/db/geo/geoquery.h"
+#include "mongo/db/matcher/expression.h"
+#include "mongo/db/matcher/expression_leaf.h"
+
+namespace mongo {
+
+ class GeoMatchExpression : public LeafMatchExpression {
+ public:
+ GeoMatchExpression() : LeafMatchExpression( GEO ){}
+ virtual ~GeoMatchExpression(){}
+
+ Status init( const StringData& path, const GeoQuery& query );
+
+ virtual bool matchesSingleElement( const BSONElement& e ) const;
+
+ virtual void debugString( StringBuilder& debug, int level = 0 ) const;
+
+ virtual bool equivalent( const MatchExpression* other ) const;
+
+ virtual LeafMatchExpression* shallowClone() const;
+
+ private:
+ GeoQuery _query;
+ };
+
+}