|
xapian-core
2.0.0
|
Virtual base class for key making functors. More...
#include <keymaker.h>
Inheritance diagram for Xapian::KeyMaker:
Collaboration diagram for Xapian::KeyMaker:Public Member Functions | |
| KeyMaker () | |
| Default constructor. More... | |
| virtual std::string | operator() (const Xapian::Document &doc) const =0 |
| Build a key string for a Document. More... | |
| virtual | ~KeyMaker () |
| Virtual destructor, because we have virtual methods. More... | |
| virtual std::string | name () const |
| Return the name of this KeyMaker. More... | |
| virtual std::string | serialise () const |
| Return this object's parameters serialised as a single string. More... | |
| virtual KeyMaker * | unserialise (const std::string &serialised, const Registry &context) const |
| Unserialise parameters. More... | |
| KeyMaker * | release () |
| Start reference counting this object. More... | |
| const KeyMaker * | release () 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_base & | operator= (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 |
Private Member Functions | |
| void | operator= (const KeyMaker &)=delete |
| Don't allow assignment. More... | |
| KeyMaker (const KeyMaker &)=delete | |
| Don't allow copying. More... | |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::opt_intrusive_base | |
| unsigned | _refs |
| Reference count. More... | |
Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base | |
| void | release () const |
| Start reference counting. More... | |
Virtual base class for key making functors.
Definition at line 43 of file keymaker.h.
|
privatedelete |
Don't allow copying.
|
inline |
Default constructor.
Definition at line 53 of file keymaker.h.
|
virtual |
Virtual destructor, because we have virtual methods.
Definition at line 38 of file keymaker.cc.
|
virtual |
Return the name of this KeyMaker.
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::FooKeyMaker, return "MyApp::FooKeyMaker" from this method.
If you don't want to support the remote backend in your KeyMaker, you can use the default implementation which simply throws Xapian::UnimplementedError.
Reimplemented in Xapian::MultiValueKeyMaker.
Definition at line 48 of file keymaker.cc.
References Xapian::throw_unimplemented().
Referenced by Xapian::Registry::Internal::add_defaults(), Xapian::Registry::register_key_maker(), and RemoteDatabase::send_global_stats().
|
pure virtual |
Build a key string for a Document.
These keys can be used for sorting or collapsing matching documents.
| doc | Document object to build a key for. |
Implemented in Xapian::MultiValueKeyMaker, Xapian::LatLongDistanceKeyMaker, NeverUseMeKeyMaker, and TestKeyMaker.
|
privatedelete |
Don't allow assignment.
|
inline |
Start reference counting this object.
You can transfer ownership of a dynamically allocated KeyMaker object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.
Definition at line 123 of file keymaker.h.
Referenced by Xapian::Registry::Internal::add_defaults(), and DEFINE_TESTCASE().
|
inline |
Start reference counting this object.
You can transfer ownership of a dynamically allocated KeyMaker object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.
Definition at line 135 of file keymaker.h.
|
virtual |
Return this object's parameters serialised as a single string.
If there are no parameters, just return an empty string.
If you don't want to support the remote backend in your KeyMaker, you can use the default implementation which simply throws Xapian::UnimplementedError.
Reimplemented in Xapian::MultiValueKeyMaker.
Definition at line 55 of file keymaker.cc.
References Xapian::throw_unimplemented().
Referenced by RemoteDatabase::send_global_stats().
|
virtual |
Unserialise parameters.
This method unserialises parameters serialised by the serialise() method and allocates and returns a new object initialised with them.
If you don't want to support the remote backend in your KeyMaker, 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
| serialised | A string containing the serialised results. |
| context | Registry object to use for unserialisation to permit KeyMaker subclasses with sub-KeyMaker objects to be implemented. |
Reimplemented in Xapian::MultiValueKeyMaker.
Definition at line 62 of file keymaker.cc.
References Xapian::throw_unimplemented().
Referenced by RemoteServer::msg_query().