Key Class Reference

#include <btree.h>

List of all members.

Public Member Functions

 Key (const byte *p_)
const byteget_address () const
void read (string *key) const
bool operator== (Key key2) const
bool operator!= (Key key2) const
bool operator< (Key key2) const
 Compares this key with key2.
bool operator>= (Key key2) const
bool operator> (Key key2) const
bool operator<= (Key key2) const
int length () const
char operator[] (size_t i) const

Private Attributes

const bytep


Detailed Description

Definition at line 156 of file btree.h.


Constructor & Destructor Documentation

Key::Key ( const byte p_  )  [inline, explicit]

Definition at line 159 of file btree.h.


Member Function Documentation

const byte* Key::get_address (  )  const [inline]

Definition at line 160 of file btree.h.

Referenced by Btree::enter_key(), Btree::find_in_block(), and Item_wr::set_key_and_block().

void Key::read ( string *  key  )  const [inline]

Definition at line 161 of file btree.h.

References K1.

bool Key::operator== ( Key  key2  )  const

Definition at line 2002 of file btree.cc.

References C2, DEBUGCALL, K1, length(), p, and RETURN.

bool Key::operator!= ( Key  key2  )  const [inline]

Definition at line 165 of file btree.h.

bool Key::operator< ( Key  key2  )  const

Compares this key with key2.

The result is true if this key precedes key2. The comparison is for byte sequence collating order, taking lengths into account. So if the keys are made up of lower case ASCII letters we get alphabetical ordering.

Now remember that items are added into the B-tree in fastest time when they are preordered by their keys. This is therefore the piece of code that needs to be followed to arrange for the preordering.

This is complicated by the fact that keys have two parts - a value and then a count. We first compare the values, and only if they are equal do we compare the counts.

Definition at line 1979 of file btree.cc.

References C2, DEBUGCALL, K1, length(), p, and RETURN.

bool Key::operator>= ( Key  key2  )  const [inline]

Definition at line 167 of file btree.h.

bool Key::operator> ( Key  key2  )  const [inline]

Definition at line 168 of file btree.h.

bool Key::operator<= ( Key  key2  )  const [inline]

Definition at line 169 of file btree.h.

int Key::length (  )  const [inline]

Definition at line 170 of file btree.h.

References C2, GETK, and K1.

Referenced by Btree::add(), Btree::enter_key(), operator<(), operator==(), and Item_wr::set_key_and_block().

char Key::operator[] ( size_t  i  )  const [inline]

Definition at line 173 of file btree.h.

References K1.


Member Data Documentation

const byte* Key::p [private]

Definition at line 157 of file btree.h.

Referenced by operator<(), and operator==().


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.