xapian-core
1.5.0
|
Virtual base class for key making functors. More...
Public Member Functions | |
KeyMaker () | |
Default constructor. | |
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. | |
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... | |
Virtual base class for key making functors.
|
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.
|
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, and Xapian::LatLongDistanceKeyMaker.
|
inline |
|
inline |
|
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.
|
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.