ChertSynonymTable Class Reference

#include <chert_synonym.h>

Inheritance diagram for ChertSynonymTable:

Inheritance graph
[legend]
Collaboration diagram for ChertSynonymTable:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChertSynonymTable (const std::string &dbdir, bool readonly)
 Create a new ChertSynonymTable object.
void merge_changes ()
void discard_changes ()
void add_synonym (const std::string &term, const std::string &synonym)
 Add a synonym for term.
void remove_synonym (const std::string &term, const std::string &synonym)
 Remove a synonym for term.
void clear_synonyms (const std::string &term)
 Remove all synonyms for term.
TermListopen_termlist (const std::string &term)
 Open synonym termlist for a term.
bool is_modified () const
 Override methods of ChertTable.
void flush_db ()
 Override methods of ChertTable.
void cancel ()
 Override methods of ChertTable.

Private Attributes

std::string last_term
 The last term which was updated.
std::set< std::string > last_synonyms
 The synonyms for the last term which was updated.


Detailed Description

Definition at line 34 of file chert_synonym.h.


Constructor & Destructor Documentation

ChertSynonymTable::ChertSynonymTable ( const std::string &  dbdir,
bool  readonly 
) [inline]

Create a new ChertSynonymTable object.

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

Parameters:
dbdir The directory the chert database is stored in.
readonly true if we're opening read-only, else false.

Definition at line 50 of file chert_synonym.h.


Member Function Documentation

void ChertSynonymTable::add_synonym ( const std::string &  term,
const std::string &  synonym 
)

Add a synonym for term.

If the synonym has already been added, no action is taken.

Definition at line 66 of file chert_synonym.cc.

References ChertTable::get_exact_entry(), last_synonyms, last_term, MAGIC_XOR_VALUE, and merge_changes().

Referenced by ChertWritableDatabase::add_synonym().

void ChertSynonymTable::cancel (  )  [inline]

Override methods of ChertTable.

NB: these aren't virtual, but we always call them on the subclass in cases where it matters.

Reimplemented from ChertTable.

Definition at line 103 of file chert_synonym.h.

References discard_changes().

Referenced by ChertDatabase::cancel().

void ChertSynonymTable::clear_synonyms ( const std::string &  term  ) 

Remove all synonyms for term.

If term has no synonyms, no action is taken.

Definition at line 118 of file chert_synonym.cc.

References last_synonyms, last_term, and merge_changes().

Referenced by ChertWritableDatabase::clear_synonyms().

void ChertSynonymTable::discard_changes (  )  [inline]

Definition at line 58 of file chert_synonym.h.

References last_synonyms, and last_term.

Referenced by cancel().

void ChertSynonymTable::flush_db (  )  [inline]

Override methods of ChertTable.

NB: these aren't virtual, but we always call them on the subclass in cases where it matters.

Reimplemented from ChertTable.

Definition at line 98 of file chert_synonym.h.

References merge_changes().

Referenced by ChertDatabase::set_revision_number().

bool ChertSynonymTable::is_modified (  )  const [inline]

Override methods of ChertTable.

NB: these aren't virtual, but we always call them on the subclass in cases where it matters.

Reimplemented from ChertTable.

Definition at line 94 of file chert_synonym.h.

References last_term.

Referenced by ChertDatabase::apply().

void ChertSynonymTable::merge_changes (  ) 

TermList * ChertSynonymTable::open_termlist ( const std::string &  term  ) 

Open synonym termlist for a term.

If term has no synonyms, NULL is returned.

Definition at line 134 of file chert_synonym.cc.

References ChertTable::get_exact_entry(), last_synonyms, last_term, and MAGIC_XOR_VALUE.

Referenced by ChertDatabase::open_synonym_termlist().

void ChertSynonymTable::remove_synonym ( const std::string &  term,
const std::string &  synonym 
)

Remove a synonym for term.

If the synonym doesn't exist, no action is taken.

Definition at line 92 of file chert_synonym.cc.

References ChertTable::get_exact_entry(), last_synonyms, last_term, MAGIC_XOR_VALUE, and merge_changes().

Referenced by ChertWritableDatabase::remove_synonym().


Member Data Documentation

std::set<std::string> ChertSynonymTable::last_synonyms [mutable, private]

The synonyms for the last term which was updated.

Definition at line 39 of file chert_synonym.h.

Referenced by add_synonym(), clear_synonyms(), discard_changes(), merge_changes(), open_termlist(), and remove_synonym().

std::string ChertSynonymTable::last_term [mutable, private]

The last term which was updated.

Definition at line 36 of file chert_synonym.h.

Referenced by add_synonym(), clear_synonyms(), discard_changes(), is_modified(), merge_changes(), open_termlist(), and remove_synonym().


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

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.