xapian-core  2.0.0
Private Member Functions | Friends | List of all members
InMemoryDocument Class Reference

A document read from a InMemoryDatabase. More...

#include <inmemory_document.h>

+ Inheritance diagram for InMemoryDocument:
+ Collaboration diagram for InMemoryDocument:

Protected Member Functions

std::string fetch_value (Xapian::valueno slot) const
 Implementation of virtual methods. More...
 
void fetch_all_values (std::map< Xapian::valueno, std::string > &values_) const
 Implementation of virtual methods. More...
 
std::string fetch_data () const
 Implementation of virtual methods. More...
 
- Protected Member Functions inherited from Xapian::Document::Internal
 Internal (Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database_, Xapian::docid did_)
 Constructor used by subclasses. More...
 
 Internal (const Xapian::Database::Internal *database_, Xapian::docid did_, std::string &&data_, std::map< Xapian::valueno, std::string > &&values_)
 Constructor used by RemoteDocument subclass. More...
 

Private Member Functions

void operator= (const InMemoryDocument &)
 Don't allow assignment. More...
 
 InMemoryDocument (const InMemoryDocument &)
 Don't allow copying. More...
 
 InMemoryDocument (const Xapian::Database::Internal *db, Xapian::docid did_)
 Private constructor - only called by InMemoryDatabase::open_document(). More...
 

Friends

class InMemoryDatabase
 InMemoryDatabase::open_document() needs to call our private constructor. More...
 

Additional Inherited Members

- Public Types inherited from Xapian::Document::Internal
enum  remove_posting_result { OK , NO_TERM , NO_POS }
 
- Public Member Functions inherited from Xapian::Document::Internal
 Internal ()
 Construct an empty document. More...
 
virtual ~Internal ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More...
 
bool data_modified () const
 Return true if the document data might have been modified. More...
 
bool terms_modified () const
 Return true if the document's terms might have been modified. More...
 
bool values_modified () const
 Return true if the document's values might have been modified. More...
 
bool modified () const
 Return true if the document might have been modified in any way. More...
 
bool positions_modified () const
 Return true if the document's term positions might have been modified. More...
 
Xapian::docid get_docid () const
 Get the document ID this document came from. More...
 
Xapian::doccount get_index () const
 Internal method used by MSet::diversify(). More...
 
void set_index (Xapian::doccount new_index)
 Internal method used by MSet::diversify(). More...
 
std::string get_data () const
 Get the document data. More...
 
void set_data (std::string_view data_)
 Set the document data. More...
 
void add_term (std::string_view term, Xapian::termcount wdf_inc)
 Add a term to this document. More...
 
bool remove_term (std::string_view term)
 Remove a term from this document. More...
 
void add_posting (std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_inc)
 Add a posting for a term. More...
 
remove_posting_result remove_posting (std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_dec)
 Remove a posting for a term. More...
 
remove_posting_result remove_postings (std::string_view term, Xapian::termpos term_pos_first, Xapian::termpos term_pos_last, Xapian::termcount wdf_dec, Xapian::termpos &n_removed)
 Remove a range of postings for a term. More...
 
void clear_terms ()
 Clear all terms from the document. More...
 
Xapian::termcount termlist_count () const
 Return the number of distinct terms in this document. More...
 
TermListopen_term_list () const
 Start iterating the terms in this document. More...
 
std::string get_value (Xapian::valueno slot) const
 Read a value slot in this document. More...
 
void add_value (Xapian::valueno slot, std::string_view value)
 Add a value to a slot in this document. More...
 
void clear_values ()
 Clear all value slots in this document. More...
 
Xapian::valueno values_count () const
 Count the value slots used in this document. More...
 
Xapian::ValueIterator values_begin () const
 
std::string get_description () const
 Return a string describing this object. More...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 
- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Attributes inherited from Xapian::Document::Internal
std::unique_ptr< std::map< Xapian::valueno, std::string > > values
 Document value slots and their contents. More...
 
Xapian::Internal::intrusive_ptr< const Xapian::Database::Internaldatabase
 Database this document came from. More...
 
Xapian::docid did
 The document ID this document came from in database. More...
 

Detailed Description

A document read from a InMemoryDatabase.

Definition at line 28 of file inmemory_document.h.

Constructor & Destructor Documentation

◆ InMemoryDocument() [1/2]

InMemoryDocument::InMemoryDocument ( const InMemoryDocument )
private

Don't allow copying.

◆ InMemoryDocument() [2/2]

InMemoryDocument::InMemoryDocument ( const Xapian::Database::Internal db,
Xapian::docid  did_ 
)
inlineprivate

Private constructor - only called by InMemoryDatabase::open_document().

Definition at line 39 of file inmemory_document.h.

Member Function Documentation

◆ fetch_all_values()

void InMemoryDocument::fetch_all_values ( std::map< Xapian::valueno, std::string > &  values_) const
protectedvirtual

Implementation of virtual methods.

Reimplemented from Xapian::Document::Internal.

Definition at line 47 of file inmemory_document.cc.

References InMemoryDatabase::closed, LOGCALL_VOID, rare, InMemoryDatabase::throw_database_closed(), and InMemoryDatabase::valuelists.

◆ fetch_data()

string InMemoryDocument::fetch_data ( ) const
protectedvirtual

◆ fetch_value()

string InMemoryDocument::fetch_value ( Xapian::valueno  slot) const
protectedvirtual

Implementation of virtual methods.

Reimplemented from Xapian::Document::Internal.

Definition at line 32 of file inmemory_document.cc.

References LOGCALL, rare, RETURN, and InMemoryDatabase::valuelists.

◆ operator=()

void InMemoryDocument::operator= ( const InMemoryDocument )
private

Don't allow assignment.

Friends And Related Function Documentation

◆ InMemoryDatabase

friend class InMemoryDatabase
friend

InMemoryDatabase::open_document() needs to call our private constructor.

Definition at line 36 of file inmemory_document.h.


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