xapian-core  2.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ValueStreamDocument Class Reference

A document which gets its values from a ValueStreamManager. More...

#include <valuestreamdocument.h>

+ Inheritance diagram for ValueStreamDocument:
+ Collaboration diagram for ValueStreamDocument:

Public Member Functions

 ValueStreamDocument (const Xapian::Database &db_)
 
void new_shard (Xapian::doccount n)
 
 ~ValueStreamDocument ()
 
void set_shard_document (Xapian::docid shard_did)
 
void set_document (Xapian::docid did_)
 
std::string get_value (Xapian::valueno slot) const
 
- 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...
 

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 ValueStreamDocument &)
 Don't allow assignment. More...
 
 ValueStreamDocument (const ValueStreamDocument &)
 Don't allow copying. More...
 
 ValueStreamDocument (const Xapian::Database &db_, Xapian::doccount n_shards_)
 Private constructor. More...
 

Private Attributes

std::map< Xapian::valueno, ValueList * > valuelists
 
Xapian::Database db
 
Xapian::doccount current = 0
 
Xapian::doccount n_shards
 
Xapian::Document::Internaldoc = NULL
 

Additional Inherited Members

- Public Types inherited from Xapian::Document::Internal
enum  remove_posting_result { OK , NO_TERM , NO_POS }
 
- 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 which gets its values from a ValueStreamManager.

Definition at line 35 of file valuestreamdocument.h.

Constructor & Destructor Documentation

◆ ValueStreamDocument() [1/3]

ValueStreamDocument::ValueStreamDocument ( const ValueStreamDocument )
private

Don't allow copying.

◆ ValueStreamDocument() [2/3]

ValueStreamDocument::ValueStreamDocument ( const Xapian::Database db_,
Xapian::doccount  n_shards_ 
)
inlineprivate

Private constructor.

This is an implementation detail - the public constructor forwards to this constructor so we can use n_shards_ to init our parent class.

Definition at line 57 of file valuestreamdocument.h.

◆ ValueStreamDocument() [3/3]

ValueStreamDocument::ValueStreamDocument ( const Xapian::Database db_)
inlineexplicit

Definition at line 66 of file valuestreamdocument.h.

◆ ~ValueStreamDocument()

ValueStreamDocument::~ValueStreamDocument ( )

Definition at line 40 of file valuestreamdocument.cc.

References clear_valuelists().

Member Function Documentation

◆ fetch_all_values()

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

Implementation of virtual methods.

Reimplemented from Xapian::Document::Internal.

Definition at line 90 of file valuestreamdocument.cc.

◆ fetch_data()

string ValueStreamDocument::fetch_data ( ) const
protectedvirtual

Implementation of virtual methods.

Reimplemented from Xapian::Document::Internal.

Definition at line 99 of file valuestreamdocument.cc.

◆ fetch_value()

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

◆ get_value()

std::string ValueStreamDocument::get_value ( Xapian::valueno  slot) const
inline

Definition at line 87 of file valuestreamdocument.h.

References fetch_value().

Referenced by Matcher::get_local_mset().

◆ new_shard()

void ValueStreamDocument::new_shard ( Xapian::doccount  n)

◆ operator=()

void ValueStreamDocument::operator= ( const ValueStreamDocument )
private

Don't allow assignment.

◆ set_document()

void ValueStreamDocument::set_document ( Xapian::docid  did_)
inline

◆ set_shard_document()

void ValueStreamDocument::set_shard_document ( Xapian::docid  shard_did)
inline

Definition at line 73 of file valuestreamdocument.h.

References Xapian::Document::Internal::did, and doc.

Referenced by set_document(), and DeciderPostList::test_doc().

Member Data Documentation

◆ current

Xapian::doccount ValueStreamDocument::current = 0
private

Definition at line 46 of file valuestreamdocument.h.

Referenced by set_document().

◆ db

Xapian::Database ValueStreamDocument::db
private

Definition at line 44 of file valuestreamdocument.h.

◆ doc

Xapian::Document::Internal* ValueStreamDocument::doc = NULL
mutableprivate

Definition at line 50 of file valuestreamdocument.h.

Referenced by set_shard_document().

◆ n_shards

Xapian::doccount ValueStreamDocument::n_shards
private

Definition at line 48 of file valuestreamdocument.h.

Referenced by set_document().

◆ valuelists

std::map<Xapian::valueno, ValueList *> ValueStreamDocument::valuelists
mutableprivate

Definition at line 42 of file valuestreamdocument.h.


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