xapian-core  2.0.0
Public Member Functions | Static Public Member Functions | List of all members
HoneyTermListTable Class Reference

#include <honey_termlisttable.h>

+ Inheritance diagram for HoneyTermListTable:
+ Collaboration diagram for HoneyTermListTable:

Public Member Functions

 HoneyTermListTable (const std::string &dbdir, bool readonly, bool lazy_)
 Create a new HoneyTermListTable object. More...
 
 HoneyTermListTable (int fd, off_t offset_, bool readonly, bool lazy_)
 
void set_termlist (Xapian::docid did, const Xapian::Document &doc, Xapian::termcount doclen)
 Set the termlist data for document did. More...
 
void delete_termlist (Xapian::docid did)
 Delete the termlist data for document did. More...
 
- Public Member Functions inherited from HoneyTable
 HoneyTable (const char *, const std::string &path_, bool read_only_, bool lazy_=false)
 
 HoneyTable (const char *, int fd, off_t offset_, bool read_only_, bool lazy_=false)
 
 ~HoneyTable ()
 
bool is_writable () const
 
int get_flags () const
 
void create_and_open (int flags_, const Honey::RootInfo &root_info)
 
void open (int flags_, const Honey::RootInfo &root_info, honey_revision_number_t)
 
void close (bool permanent)
 
const std::string & get_path () const
 
void add (std::string_view key, const char *val, size_t val_size, bool compressed=false)
 
void add (std::string_view key, std::string_view val, bool compressed=false)
 
void flush_db ()
 
void cancel (const Honey::RootInfo &, honey_revision_number_t)
 
void commit (honey_revision_number_t, Honey::RootInfo *root_info)
 
bool sync ()
 
bool empty () const
 
bool get_exact_entry (std::string_view key, std::string &tag) const
 
bool key_exists (const std::string &key) const
 
bool del (const std::string &)
 
bool readahead_key (const std::string &) const
 
bool is_modified () const
 
HoneyCursorcursor_get () const
 
bool exists () const
 
bool is_open () const
 
honey_tablesize_t get_entry_count () const
 
honey_tablesize_t get_approx_entry_count () const
 Return an approximation of the number of entries in the table. More...
 
off_t get_root () const
 
off_t get_offset () const
 

Static Public Member Functions

static std::string make_key (Xapian::docid did)
 
- Static Public Member Functions inherited from HoneyTable
static void throw_database_closed ()
 

Detailed Description

Definition at line 36 of file honey_termlisttable.h.

Constructor & Destructor Documentation

◆ HoneyTermListTable() [1/2]

HoneyTermListTable::HoneyTermListTable ( const std::string &  dbdir,
bool  readonly,
bool  lazy_ 
)
inline

Create a new HoneyTermListTable object.

This method does not create or open the table on disk - you must call the create() or open() methods respectively!

Parameters
dbdirThe directory the honey database is stored in.
readonlytrue if we're opening read-only, else false.
lazy_Don't create a termlist if there isn't one.

Definition at line 53 of file honey_termlisttable.h.

◆ HoneyTermListTable() [2/2]

HoneyTermListTable::HoneyTermListTable ( int  fd,
off_t  offset_,
bool  readonly,
bool  lazy_ 
)
inline

Definition at line 56 of file honey_termlisttable.h.

Member Function Documentation

◆ delete_termlist()

void HoneyTermListTable::delete_termlist ( Xapian::docid  did)
inline

Delete the termlist data for document did.

Parameters
didThe docid to delete the termlist data for.

Definition at line 74 of file honey_termlisttable.h.

References HoneyTable::del(), and make_key().

◆ make_key()

static std::string HoneyTermListTable::make_key ( Xapian::docid  did)
inlinestatic

Definition at line 38 of file honey_termlisttable.h.

References pack_uint_preserving_sort().

Referenced by delete_termlist(), and HoneyTermList::HoneyTermList().

◆ set_termlist()

void HoneyTermListTable::set_termlist ( Xapian::docid  did,
const Xapian::Document doc,
Xapian::termcount  doclen 
)

Set the termlist data for document did.

Any existing data is replaced.

Parameters
didThe docid to set the termlist data for.
docThe Xapian::Document object to read term data from.
doclenThe document length.

Definition at line 39 of file honey_termlisttable.cc.

References Assert, common_prefix_length(), Xapian::TermIterator::get_wdf(), LOGCALL_VOID, pack_uint(), rare, term, Xapian::Document::termlist_begin(), Xapian::Document::termlist_count(), Xapian::Document::termlist_end(), and usual.


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