Xapian: API Documentation: Xapian::Registry Class Reference

xapian-core 2.1.0

Public Member Functions | List of all members
Xapian::Registry Class Reference

Registry for user subclasses. More...

`#include <registry.h>`

## Public Member Functions
| Registry (const Registry &other)
| Copy constructor.
Registry & | operator= (const Registry &other)
| Assignment operator.
| Registry (Registry &&other)
| Move constructor.
Registry & | operator= (Registry &&other)
| Move assignment operator.
| Registry ()
| Default constructor.
void | register_weighting_scheme (const Xapian::Weight &wt)
| Register a weighting scheme.
const Xapian::Weight * | get_weighting_scheme (std::string_view name) const
| Get the weighting scheme given a name.
void | register_posting_source (const Xapian::PostingSource &source)
| Register a user-defined posting source class.
const Xapian::PostingSource * | get_posting_source (std::string_view name) const
| Get a posting source given a name.
void | register_match_spy (const Xapian::MatchSpy &spy)
| Register a user-defined match spy class.
const Xapian::MatchSpy * | get_match_spy (std::string_view name) const
| Get a match spy given a name.
void | register_lat_long_metric (const Xapian::LatLongMetric &metric)
| Register a user-defined lat-long metric class.
const Xapian::LatLongMetric * | get_lat_long_metric (std::string_view name) const
| Get a lat-long metric given a name.
void | register_key_maker (Xapian::KeyMaker *keymaker)
| Register a user-defined KeyMaker subclass.
const Xapian::KeyMaker * | get_key_maker (std::string_view name) const
| Get a KeyMaker given a name.

## Detailed Description

Registry for user subclasses.

This class provides a way for the remote server to look up user subclasses when unserialising.

## Constructor & Destructor Documentation

## ◆ Registry() [1/3]

Xapian::Registry::Registry | ( | const Registry & | other | ) |

Copy constructor.

The internals are reference counted, so copying is cheap.

Parameters

  other | The object to copy.

References Registry().

Referenced by operator=(), operator=(), Registry(), Registry(), and Registry().

## ◆ Registry() [2/3]

Xapian::Registry::Registry | ( | Registry && | other | ) |

Move constructor.

Parameters

  other | The object to move.

References Registry().

## ◆ Registry() [3/3]

Xapian::Registry::Registry | ( |  | ) |

Default constructor.

The registry will contain all standard subclasses of user-subclassable classes.

References Registry().

## Member Function Documentation

## ◆ get_key_maker()

const Xapian::KeyMaker * Xapian::Registry::get_key_maker | ( | std::string_view | name | ) | const

Get a KeyMaker given a name.

Parameters

  name | The name of the KeyMaker to find.

Returns
  An object with the requested name, or NULL if the KeyMaker could not be found. The returned object must not be deleted by the caller.

Since
  Added in Xapian 2.0.0.

## ◆ get_lat_long_metric()

const Xapian::LatLongMetric * Xapian::Registry::get_lat_long_metric | ( | std::string_view | name | ) | const

Get a lat-long metric given a name.

The returned metric is owned by the registry object.

Returns NULL if the metric could not be found.

## ◆ get_match_spy()

const Xapian::MatchSpy * Xapian::Registry::get_match_spy | ( | std::string_view | name | ) | const

Get a match spy given a name.

Parameters

  name | The name of the match spy to find.

Returns
  An object with the requested name, or NULL if the match spy could not be found. The returned object is owned by the registry and so must not be deleted by the caller.

## ◆ get_posting_source()

const Xapian::PostingSource * Xapian::Registry::get_posting_source | ( | std::string_view | name | ) | const

Get a posting source given a name.

Parameters

  name | The name of the posting source to find.

Returns
  An object with the requested name, or NULL if the posting source could not be found. The returned object is owned by the registry and so must not be deleted by the caller.

## ◆ get_weighting_scheme()

const Xapian::Weight * Xapian::Registry::get_weighting_scheme | ( | std::string_view | name | ) | const

Get the weighting scheme given a name.

Parameters

  name | The name of the weighting scheme to find.

Returns
  An object with the requested name, or NULL if the weighting scheme could not be found. The returned object is owned by the registry and so must not be deleted by the caller.

## ◆ operator=() [1/2]

Registry & Xapian::Registry::operator= | ( | const Registry & | other | ) |

Assignment operator.

The internals are reference counted, so assignment is cheap.

Parameters

  other | The object to copy.

References Registry().

## ◆ operator=() [2/2]

Registry & Xapian::Registry::operator= | ( | Registry && | other | ) |

Move assignment operator.

Parameters

  other | The object to move.

References Registry().

## ◆ register_key_maker()

void Xapian::Registry::register_key_maker | ( | Xapian::KeyMaker * | keymaker | ) |

Register a user-defined KeyMaker subclass.

Parameters

  keymaker | The KeyMaker subclass to register. The clean up of this object is handled via Xapian's optional reference counting. The simplest way to do so is to allocate it with `new` and call `release()` on it before passing it to this method to tell Xapian to manage its lifetime. The alternative approach is for the caller to ensure the KeyMaker object remains valid for the lifetime of the Registry object.

Since
  Added in Xapian 2.0.0.

## ◆ register_match_spy()

void Xapian::Registry::register_match_spy | ( | const Xapian::MatchSpy & | spy | ) |

Register a user-defined match spy class.

Parameters

  spy | The match spy to register.

## ◆ register_posting_source()

void Xapian::Registry::register_posting_source | ( | const Xapian::PostingSource & | source | ) |

Register a user-defined posting source class.

Parameters

  source | The posting source to register.

## ◆ register_weighting_scheme()

void Xapian::Registry::register_weighting_scheme | ( | const Xapian::Weight & | wt | ) |

Register a weighting scheme.

Parameters

  wt | The weighting scheme to register.

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

- xapian/registry.h