xapian-core  1.4.27
Public Types | Public Member Functions | Public Attributes | List of all members
ExceptionalMatchSpy Class Reference
+ Inheritance diagram for ExceptionalMatchSpy:
+ Collaboration diagram for ExceptionalMatchSpy:

Public Types

enum  failmode { NONE, CLONE }
 

Public Member Functions

 ExceptionalMatchSpy (failmode fail_)
 
string name () const override
 Return the name of this match spy. More...
 
MatchSpyclone () const override
 Clone the match spy. More...
 
void operator() (const Xapian::Document &, double) override
 Register a document with the match spy. More...
 
- Public Member Functions inherited from Xapian::MatchSpy
 MatchSpy ()
 Default constructor, needed by subclass constructors. More...
 
virtual ~MatchSpy ()
 Virtual destructor, because we have virtual methods. More...
 
virtual std::string serialise () const
 Return this object's parameters serialised as a single string. More...
 
virtual MatchSpyunserialise (const std::string &serialised, const Registry &context) const
 Unserialise parameters. More...
 
virtual std::string serialise_results () const
 Serialise the results of this match spy. More...
 
virtual void merge_results (const std::string &serialised)
 Unserialise some results, and merge them into this matchspy. More...
 
virtual std::string get_description () const
 Return a string describing this object. More...
 
MatchSpyrelease ()
 Start reference counting this object. More...
 
const MatchSpyrelease () const
 Start reference counting this object. More...
 
- Public Member Functions inherited from Xapian::Internal::opt_intrusive_base
 opt_intrusive_base (const opt_intrusive_base &)
 
opt_intrusive_baseoperator= (const opt_intrusive_base &)
 
 opt_intrusive_base ()
 Construct object which is initially not reference counted. More...
 
virtual ~opt_intrusive_base ()
 
void ref () const
 
void unref () const
 

Public Attributes

failmode fail
 
- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base
void release () const
 Start reference counting. More...
 

Detailed Description

Definition at line 440 of file api_serialise.cc.

Member Enumeration Documentation

◆ failmode

Enumerator
NONE 
CLONE 

Definition at line 442 of file api_serialise.cc.

Constructor & Destructor Documentation

◆ ExceptionalMatchSpy()

ExceptionalMatchSpy::ExceptionalMatchSpy ( failmode  fail_)
inline

Definition at line 446 of file api_serialise.cc.

Member Function Documentation

◆ clone()

MatchSpy* ExceptionalMatchSpy::clone ( ) const
inlineoverridevirtual

Clone the match spy.

The clone should inherit the configuration of the parent, but need not inherit the state. ie, the clone does not need to be passed information about the results seen by the parent.

If you don't want to support the remote backend in your match spy, you can use the default implementation which simply throws Xapian::UnimplementedError.

Note that the returned object will be deallocated by Xapian after use with "delete". If you want to handle the deletion in a special way (for example when wrapping the Xapian API for use from another language) then you can define a static operator delete method in your subclass as shown here: https://trac.xapian.org/ticket/554#comment:1

Reimplemented from Xapian::MatchSpy.

Definition at line 452 of file api_serialise.cc.

◆ name()

string ExceptionalMatchSpy::name ( ) const
inlineoverridevirtual

Return the name of this match spy.

This name is used by the remote backend. It is passed with the serialised parameters to the remote server so that it knows which class to create.

Return the full namespace-qualified name of your class here - if your class is called MyApp::FooMatchSpy, return "MyApp::FooMatchSpy" from this method.

If you don't want to support the remote backend in your match spy, you can use the default implementation which simply throws Xapian::UnimplementedError.

Reimplemented from Xapian::MatchSpy.

Definition at line 448 of file api_serialise.cc.

◆ operator()()

void ExceptionalMatchSpy::operator() ( const Xapian::Document doc,
double  wt 
)
inlineoverridevirtual

Register a document with the match spy.

This is called by the matcher once with each document seen by the matcher during the match process. Note that the matcher will often not see all the documents which match the query, due to optimisations which allow low-weighted documents to be skipped, and allow the match process to be terminated early.

Parameters
docThe document seen by the match spy.
wtThe weight of the document.

Implements Xapian::MatchSpy.

Definition at line 458 of file api_serialise.cc.

Member Data Documentation

◆ fail

failmode ExceptionalMatchSpy::fail

Definition at line 444 of file api_serialise.cc.


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