#include <brass_table.h>
Public Member Functions | |
| Key (const byte *p_) | |
| const byte * | 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. | |
| 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 byte * | p |
Definition at line 115 of file brass_table.h.
| Brass::Key::Key | ( | const byte * | p_ | ) | [inline, explicit] |
Definition at line 118 of file brass_table.h.
| const byte* Brass::Key::get_address | ( | ) | const [inline] |
Definition at line 119 of file brass_table.h.
Referenced by BrassTable::enter_key(), BrassTable::find_in_block(), and Brass::Item_wr::set_key_and_block().
| int Brass::Key::length | ( | ) | const [inline] |
Definition at line 129 of file brass_table.h.
References AssertRel, C2, getK, and K1.
Referenced by BrassTable::add(), BrassTable::enter_key(), operator<(), operator==(), BrassTableCheck::print_key(), and Brass::Item_wr::set_key_and_block().
| bool Brass::Key::operator!= | ( | Key | key2 | ) | const [inline] |
Definition at line 124 of file brass_table.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 2260 of file brass_table.cc.
| bool Brass::Key::operator<= | ( | Key | key2 | ) | const [inline] |
Definition at line 128 of file brass_table.h.
| bool Key::operator== | ( | Key | key2 | ) | const |
| bool Brass::Key::operator> | ( | Key | key2 | ) | const [inline] |
Definition at line 127 of file brass_table.h.
| bool Brass::Key::operator>= | ( | Key | key2 | ) | const [inline] |
Definition at line 126 of file brass_table.h.
| char Brass::Key::operator[] | ( | size_t | i | ) | const [inline] |
| void Brass::Key::read | ( | std::string * | key | ) | const [inline] |
Definition at line 120 of file brass_table.h.
References K1.
Referenced by BrassTableCheck::print_key().
const byte* Brass::Key::p [private] |
Definition at line 116 of file brass_table.h.
Referenced by BrassTable::find(), operator<(), and operator==().