xapian-core  2.0.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Xapian::RSet Class Reference

Class representing a set of documents judged as relevant. More...

#include <rset.h>

+ Collaboration diagram for Xapian::RSet:

Classes

class  Internal
 

Public Member Functions

 RSet (const RSet &o)
 Copying is allowed. More...
 
RSetoperator= (const RSet &o)
 Copying is allowed. More...
 
 RSet (RSet &&o)
 Move constructor. More...
 
RSetoperator= (RSet &&o)
 Move assignment operator. More...
 
 RSet ()
 Default constructor. More...
 
 ~RSet ()
 Destructor. More...
 
Xapian::doccount size () const
 Return number of documents in this RSet object. More...
 
bool empty () const
 Return true if this RSet object is empty. More...
 
void swap (RSet &o)
 Efficiently swap this RSet object with another. More...
 
void add_document (Xapian::docid did)
 Mark a document as relevant. More...
 
void add_document (const Xapian::MSetIterator &it)
 Mark a document as relevant. More...
 
void remove_document (Xapian::docid did)
 Unmark a document as relevant. More...
 
void remove_document (const Xapian::MSetIterator &it)
 Unmark a document as relevant. More...
 
bool contains (Xapian::docid did) const
 Check if a document is marked as relevant. More...
 
bool contains (const Xapian::MSetIterator &it) const
 Check if a document is marked as relevant. More...
 
std::string get_description () const
 Return a string describing this object. More...
 

Private Member Functions

 RSet (Internal *internal_)
 

Private Attributes

Xapian::Internal::intrusive_ptr< Internalinternal
 

Detailed Description

Class representing a set of documents judged as relevant.

Definition at line 39 of file rset.h.

Constructor & Destructor Documentation

◆ RSet() [1/4]

Xapian::RSet::RSet ( const RSet o)
default

Copying is allowed.

The internals are reference counted, so copying is cheap.

◆ RSet() [2/4]

Xapian::RSet::RSet ( RSet &&  o)
default

Move constructor.

◆ RSet() [3/4]

Xapian::RSet::RSet ( )

Default constructor.

Creates an empty RSet.

Definition at line 42 of file rset.cc.

Referenced by Xapian::RSet::Internal::shard().

◆ RSet() [4/4]

Xapian::RSet::RSet ( Internal internal_)
explicitprivate

Wrap an existing Internal.

Definition at line 44 of file rset.cc.

◆ ~RSet()

Xapian::RSet::~RSet ( )

Destructor.

Definition at line 46 of file rset.cc.

Member Function Documentation

◆ add_document() [1/2]

void Xapian::RSet::add_document ( const Xapian::MSetIterator it)
inline

Mark a document as relevant.

If did is already marked as relevant, nothing happens.

Definition at line 96 of file rset.h.

◆ add_document() [2/2]

void Xapian::RSet::add_document ( Xapian::docid  did)

Mark a document as relevant.

If did is already marked as relevant, nothing happens.

Definition at line 55 of file rset.cc.

References Xapian::RSet::Internal::docs, and rare.

Referenced by DEFINE_TESTCASE(), main(), and unserialise_rset().

◆ contains() [1/2]

bool Xapian::RSet::contains ( const Xapian::MSetIterator it) const
inline

Check if a document is marked as relevant.

Definition at line 118 of file rset.h.

References contains().

◆ contains() [2/2]

bool Xapian::RSet::contains ( Xapian::docid  did) const

Check if a document is marked as relevant.

Definition at line 74 of file rset.cc.

◆ empty()

bool Xapian::RSet::empty ( ) const
inline

Return true if this RSet object is empty.

Definition at line 81 of file rset.h.

Referenced by Xapian::build_termlist_tree(), DEFINE_TESTCASE(), Xapian::ESet::Internal::expand(), Xapian::Enquire::Internal::get_eset(), and main().

◆ get_description()

string Xapian::RSet::get_description ( ) const

Return a string describing this object.

Definition at line 80 of file rset.cc.

References internal, and Xapian::Internal::str().

Referenced by DEFINE_TESTCASE().

◆ operator=() [1/2]

RSet & Xapian::RSet::operator= ( const RSet o)
default

Copying is allowed.

The internals are reference counted, so assignment is cheap.

◆ operator=() [2/2]

RSet & Xapian::RSet::operator= ( RSet &&  o)
default

Move assignment operator.

◆ remove_document() [1/2]

void Xapian::RSet::remove_document ( const Xapian::MSetIterator it)
inline

Unmark a document as relevant.

If did is not marked as relevant, nothing happens.

Definition at line 110 of file rset.h.

◆ remove_document() [2/2]

void Xapian::RSet::remove_document ( Xapian::docid  did)

Unmark a document as relevant.

If did is not marked as relevant, nothing happens.

Definition at line 65 of file rset.cc.

References rare.

◆ size()

Xapian::doccount Xapian::RSet::size ( ) const

Return number of documents in this RSet object.

Definition at line 49 of file rset.cc.

Referenced by Xapian::Weight::Internal::accumulate_stats(), DEFINE_TESTCASE(), and Xapian::Enquire::Internal::get_eset().

◆ swap()

void Xapian::RSet::swap ( RSet o)
inline

Efficiently swap this RSet object with another.

Definition at line 84 of file rset.h.

References internal.

Member Data Documentation

◆ internal

Xapian::Internal::intrusive_ptr<Internal> Xapian::RSet::internal
private

Reference counted internals.

Definition at line 44 of file rset.h.

Referenced by Xapian::Weight::Internal::accumulate_stats(), Xapian::build_termlist_tree(), get_description(), serialise_rset(), and swap().


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