diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-02-28 00:51:39 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-02-28 00:51:39 -0500 |
commit | 30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7 (patch) | |
tree | 3f1b116523e14150fed12ec2b069753fba6ab8fd /db/index.h | |
parent | 00ca5d90fe11b3e3fa6c3651542113736adddcf1 (diff) | |
download | mongo-30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7.tar.gz |
some cleaning
Diffstat (limited to 'db/index.h')
-rw-r--r-- | db/index.h | 16 |
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; }; /** |