xapian-core  1.4.25
Public Member Functions | Private Attributes | List of all members
Key Class Reference

#include <chert_table.h>

Public Member Functions

 Key (const uint8_t *p_)
 
const uint8_t * get_address () const
 
void read (std::string *key) const
 
bool operator== (Key key2) const
 
bool operator!= (Key key2) const
 
bool operator< (Key key2) const
 Compares this key with key2. More...
 
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 uint8_t * p
 

Detailed Description

Definition at line 167 of file chert_table.h.

Constructor & Destructor Documentation

◆ Key()

Key::Key ( const uint8_t *  p_)
inlineexplicit

Definition at line 170 of file chert_table.h.

Referenced by Item_base< uint8_t *>::key().

Member Function Documentation

◆ get_address()

const uint8_t* Key::get_address ( ) const
inline

Definition at line 171 of file chert_table.h.

References p.

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

◆ length()

int Key::length ( ) const
inline

◆ operator!=()

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

Definition at line 176 of file chert_table.h.

References operator<().

◆ operator<()

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 2277 of file chert_table.cc.

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

Referenced by operator!=().

◆ operator<=()

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

Definition at line 180 of file chert_table.h.

◆ operator==()

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

Definition at line 2300 of file chert_table.cc.

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

Referenced by read().

◆ operator>()

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

Definition at line 179 of file chert_table.h.

◆ operator>=()

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

Definition at line 178 of file chert_table.h.

◆ operator[]()

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

Definition at line 185 of file chert_table.h.

References AssertRel, K1, and length().

◆ read()

void Key::read ( std::string *  key) const
inline

Definition at line 172 of file chert_table.h.

References K1, length(), and operator==().

Referenced by ChertCursor::get_key(), and ChertTableCheck::print_key().

Member Data Documentation

◆ p

const uint8_t* Key::p
private

The documentation for this class was generated from the following files: