QuartzRecordTable Class Reference

A record in a quartz database. More...

#include <quartz_record.h>

Inheritance diagram for QuartzRecordTable:

Inheritance graph
[legend]
Collaboration diagram for QuartzRecordTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 QuartzRecordTable (string path_, bool readonly_)
 Create a new table object.
string get_record (Xapian::docid did) const
 Retrieve a document from the table.
Xapian::doccount get_doccount () const
 Get the number of records in the table.
quartz_totlen_t get_total_length () const
 Return the total length of all the records in the table.
Xapian::docid get_lastdocid () const
 Get the last document id used.
void set_total_length_and_lastdocid (quartz_totlen_t totlen, Xapian::docid did)
 Set the total length and last document ID used.
void replace_record (const string &data, Xapian::docid did)
void delete_record (Xapian::docid did)
 Delete a record from the table.

Detailed Description

A record in a quartz database.

Definition at line 38 of file quartz_record.h.


Constructor & Destructor Documentation

QuartzRecordTable::QuartzRecordTable ( string  path_,
bool  readonly_ 
) [inline]

Create a new table object.

This does not create the table on disk - the create() method must be called before the table is created on disk

This also does not open the table - the open() method must be called before use is made of the table.

Parameters:
path_ - Path at which the table is stored.
readonly_ - whether to open the table for read only access.
blocksize_ - Size of blocks to use. This parameter is only used when creating the table.

Definition at line 54 of file quartz_record.h.


Member Function Documentation

string QuartzRecordTable::get_record ( Xapian::docid  did  )  const

Retrieve a document from the table.

Definition at line 40 of file quartz_record.cc.

References DEBUGCALL, Btree::get_exact_entry(), om_tostring(), quartz_docid_to_key(), and RETURN.

Referenced by QuartzDocument::do_get_data(), and QuartzDocument::QuartzDocument().

Xapian::doccount QuartzRecordTable::get_doccount (  )  const

Get the number of records in the table.

Definition at line 55 of file quartz_record.cc.

References CASSERT, CASSERT_TYPE_UNSIGNED, DEBUGCALL, Btree::get_entry_count(), and RETURN.

Referenced by QuartzDatabase::get_avlength(), QuartzDatabase::get_doccount(), and QuartzDatabase::QuartzDatabase().

quartz_totlen_t QuartzRecordTable::get_total_length (  )  const

Return the total length of all the records in the table.

Definition at line 105 of file quartz_record.cc.

References DEBUGCALL, Btree::get_exact_entry(), METAINFO_KEY(), RETURN, unpack_uint(), and unpack_uint_last().

Referenced by QuartzWritableDatabase::cancel(), and QuartzDatabase::get_avlength().

Xapian::docid QuartzRecordTable::get_lastdocid (  )  const

Get the last document id used.

Definition at line 69 of file quartz_record.cc.

References DEBUGCALL, Btree::get_exact_entry(), METAINFO_KEY(), RETURN, and unpack_uint().

Referenced by QuartzDatabase::get_lastdocid(), and QuartzDatabase::QuartzDatabase().

void QuartzRecordTable::set_total_length_and_lastdocid ( quartz_totlen_t  totlen,
Xapian::docid  did 
)

Set the total length and last document ID used.

Definition at line 94 of file quartz_record.cc.

References DEBUGCALL, METAINFO_KEY(), pack_uint(), and pack_uint_last().

Referenced by QuartzDatabase::create_and_open_tables(), QuartzWritableDatabase::do_flush_const(), and QuartzDatabase::QuartzDatabase().

void QuartzRecordTable::replace_record ( const string &  data,
Xapian::docid  did 
)

Definition at line 86 of file quartz_record.cc.

References DEBUGCALL, and quartz_docid_to_key().

Referenced by QuartzWritableDatabase::add_document_(), and QuartzWritableDatabase::replace_document().

void QuartzRecordTable::delete_record ( Xapian::docid  did  ) 

Delete a record from the table.

Definition at line 126 of file quartz_record.cc.

References DEBUGCALL, Btree::del(), om_tostring(), and quartz_docid_to_key().

Referenced by QuartzWritableDatabase::delete_document().


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.