FlintValueTable Class Reference

#include <flint_values.h>

Inheritance diagram for FlintValueTable:

Inheritance graph
[legend]
Collaboration diagram for FlintValueTable:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FlintValueTable (const string &path_, bool readonly_)
 Create a new table object.
void encode_values (string &s, Xapian::ValueIterator it, const Xapian::ValueIterator &end)
 Encode values as a string ready to add to the table.
void set_encoded_values (Xapian::docid did, const string &enc)
 Set values for document did encoded as a string.
void get_value (string &value, Xapian::docid did, Xapian::valueno slot) const
 Get a value.
void get_all_values (map< Xapian::valueno, string > &values, Xapian::docid did) const
 Get all values.
void delete_all_values (Xapian::docid did)
 Remove all values.

Static Private Member Functions

static void unpack_entry (const char **pos, const char *end, Xapian::valueno *this_value_no, string &this_value)
 Read an entry from position.


Detailed Description

Definition at line 35 of file flint_values.h.


Constructor & Destructor Documentation

FlintValueTable::FlintValueTable ( const 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.

Definition at line 58 of file flint_values.h.


Member Function Documentation

void FlintValueTable::delete_all_values ( Xapian::docid  did  ) 

Remove all values.

Parameters:
did The document id for which to remove the values.

Definition at line 143 of file flint_values.cc.

References FlintTable::del(), LOGCALL_VOID, and make_key().

Referenced by FlintWritableDatabase::delete_document(), and FlintWritableDatabase::replace_document().

void FlintValueTable::encode_values ( string &  s,
Xapian::ValueIterator  it,
const Xapian::ValueIterator end 
)

Encode values as a string ready to add to the table.

Definition at line 63 of file flint_values.cc.

References F_pack_string(), F_pack_uint(), Xapian::ValueIterator::get_valueno(), and LOGCALL_VOID.

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

void FlintValueTable::get_all_values ( map< Xapian::valueno, string > &  values,
Xapian::docid  did 
) const

Get all values.

Parameters:
values A map to be filled with all the values for the specified document.

Definition at line 118 of file flint_values.cc.

References FlintTable::get_exact_entry(), LOGCALL_VOID, make_key(), and unpack_entry().

void FlintValueTable::get_value ( string &  value,
Xapian::docid  did,
Xapian::valueno  slot 
) const

Get a value.

Returns:
The value if found, a null value otherwise.

Definition at line 85 of file flint_values.cc.

References FlintTable::get_exact_entry(), LOGCALL_VOID, make_key(), and unpack_entry().

Referenced by FlintDocument::do_get_value().

void FlintValueTable::set_encoded_values ( Xapian::docid  did,
const string &  enc 
)

Set values for document did encoded as a string.

Definition at line 76 of file flint_values.cc.

References FlintTable::add(), LOGCALL_VOID, and make_key().

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

void FlintValueTable::unpack_entry ( const char **  pos,
const char *  end,
Xapian::valueno this_value_no,
string &  this_value 
) [static, private]

Read an entry from position.

Throw appropriate exceptions if data runs out.

Definition at line 42 of file flint_values.cc.

References F_unpack_string(), F_unpack_uint(), LOGCALL_STATIC_VOID, and LOGLINE.

Referenced by get_all_values(), and get_value().


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

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.