summaryrefslogtreecommitdiff
path: root/db/index.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-02-28 00:51:39 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-28 00:51:39 -0500
commit30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7 (patch)
tree3f1b116523e14150fed12ec2b069753fba6ab8fd /db/index.h
parent00ca5d90fe11b3e3fa6c3651542113736adddcf1 (diff)
downloadmongo-30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7.tar.gz
some cleaning
Diffstat (limited to 'db/index.h')
-rw-r--r--db/index.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/db/index.h b/db/index.h
index 77b3f5ce892..61e10657cf4 100644
--- a/db/index.h
+++ b/db/index.h
@@ -38,20 +38,26 @@ namespace mongo {
*/
class IndexType : boost::noncopyable {
public:
- IndexType( const IndexPlugin * plugin );
+ IndexType( const IndexPlugin * plugin , const IndexSpec * spec );
virtual ~IndexType();
virtual void getKeys( const BSONObj &obj, BSONObjSetDefaultOrder &keys ) const = 0;
- virtual int compare( const IndexSpec& spec , const BSONObj& l , const BSONObj& r ) const;
+ virtual auto_ptr<Cursor> newCursor( const BSONObj& query , const BSONObj& order , int numWanted ) const = 0;
- const IndexPlugin * getPlugin() const { return _plugin; }
+ /** optional op : changes query to match what's in the index */
+ virtual BSONObj fixKey( const BSONObj& in ) { return in; }
- virtual auto_ptr<Cursor> newCursor( const BSONObj& query , const BSONObj& order , int numWanted ) const = 0;
+ /** optional op : compare 2 objects with regards to this index */
+ virtual int compare( const BSONObj& l , const BSONObj& r ) const;
- virtual BSONObj fixKey( const BSONObj& in ) { return in; }
+ /** @return plugin */
+ const IndexPlugin * getPlugin() const { return _plugin; }
+
+ const BSONObj& keyPattern() const;
protected:
const IndexPlugin * _plugin;
+ const IndexSpec * _spec;
};
/**