xapian-core
1.4.26
|
Registry for user subclasses. More...
#include <registry.h>
Classes | |
class | Internal |
Public Member Functions | |
Registry (const Registry &other) | |
Copy constructor. More... | |
Registry & | operator= (const Registry &other) |
Assignment operator. More... | |
Registry () | |
Default constructor. More... | |
~Registry () | |
void | register_weighting_scheme (const Xapian::Weight &wt) |
Register a weighting scheme. More... | |
const Xapian::Weight * | get_weighting_scheme (const std::string &name) const |
Get the weighting scheme given a name. More... | |
void | register_posting_source (const Xapian::PostingSource &source) |
Register a user-defined posting source class. More... | |
const Xapian::PostingSource * | get_posting_source (const std::string &name) const |
Get a posting source given a name. More... | |
void | register_match_spy (const Xapian::MatchSpy &spy) |
Register a user-defined match spy class. More... | |
const Xapian::MatchSpy * | get_match_spy (const std::string &name) const |
Get a match spy given a name. More... | |
void | register_lat_long_metric (const Xapian::LatLongMetric &metric) |
Register a user-defined lat-long metric class. More... | |
const Xapian::LatLongMetric * | get_lat_long_metric (const std::string &name) const |
Get a lat-long metric given a name. More... | |
Private Attributes | |
Xapian::Internal::intrusive_ptr< Internal > | internal |
Registry for user subclasses.
This class provides a way for the remote server to look up user subclasses when unserialising.
Definition at line 47 of file registry.h.
Xapian::Registry::Registry | ( | const Registry & | other | ) |
Copy constructor.
The internals are reference counted, so copying is cheap.
other | The object to copy. |
Definition at line 229 of file registry.cc.
References LOGCALL_CTOR.
Xapian::Registry::Registry | ( | ) |
Default constructor.
The registry will contain all standard subclasses of user-subclassable classes.
Definition at line 248 of file registry.cc.
References LOGCALL_CTOR.
Referenced by operator=().
Xapian::Registry::~Registry | ( | ) |
Definition at line 254 of file registry.cc.
References LOGCALL_DTOR.
const Xapian::LatLongMetric * Xapian::Registry::get_lat_long_metric | ( | const std::string & | 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.
Definition at line 314 of file registry.cc.
References internal, LOGCALL, lookup_object(), and RETURN.
Referenced by DEFINE_TESTCASE(), and Xapian::LatLongDistancePostingSource::unserialise_with_registry().
const Xapian::MatchSpy * Xapian::Registry::get_match_spy | ( | const std::string & | name | ) | const |
Get a match spy given a name.
name | The name of the match spy to find. |
Definition at line 300 of file registry.cc.
References internal, LOGCALL, lookup_object(), and RETURN.
Referenced by DEFINE_TESTCASE(), and RemoteServer::msg_query().
const Xapian::PostingSource * Xapian::Registry::get_posting_source | ( | const std::string & | name | ) | const |
Get a posting source given a name.
name | The name of the posting source to find. |
Definition at line 286 of file registry.cc.
References internal, LOGCALL, lookup_object(), and RETURN.
Referenced by DEFINE_TESTCASE(), and Xapian::Query::Internal::unserialise().
const Xapian::Weight * Xapian::Registry::get_weighting_scheme | ( | const std::string & | name | ) | const |
Get the weighting scheme given a name.
name | The name of the weighting scheme to find. |
Definition at line 272 of file registry.cc.
References internal, LOGCALL, lookup_object(), and RETURN.
Referenced by DEFINE_TESTCASE(), and RemoteServer::msg_query().
Assignment operator.
The internals are reference counted, so assignment is cheap.
other | The object to copy. |
Definition at line 236 of file registry.cc.
References internal, LOGCALL, Registry(), and RETURN.
void Xapian::Registry::register_lat_long_metric | ( | const Xapian::LatLongMetric & | metric | ) |
Register a user-defined lat-long metric class.
Definition at line 307 of file registry.cc.
References internal, LOGCALL_VOID, Xapian::LatLongMetric::name(), and register_object().
void Xapian::Registry::register_match_spy | ( | const Xapian::MatchSpy & | spy | ) |
Register a user-defined match spy class.
spy | The match spy to register. |
Definition at line 293 of file registry.cc.
References internal, LOGCALL_VOID, Xapian::MatchSpy::name(), and register_object().
Referenced by DEFINE_TESTCASE().
void Xapian::Registry::register_posting_source | ( | const Xapian::PostingSource & | source | ) |
Register a user-defined posting source class.
source | The posting source to register. |
Definition at line 279 of file registry.cc.
References internal, LOGCALL_VOID, Xapian::PostingSource::name(), and register_object().
Referenced by DEFINE_TESTCASE().
void Xapian::Registry::register_weighting_scheme | ( | const Xapian::Weight & | wt | ) |
Register a weighting scheme.
wt | The weighting scheme to register. |
Definition at line 265 of file registry.cc.
References internal, LOGCALL_VOID, Xapian::Weight::name(), and register_object().
Referenced by DEFINE_TESTCASE().
|
private |
Reference counted internals.
Definition at line 50 of file registry.h.
Referenced by get_lat_long_metric(), get_match_spy(), get_posting_source(), get_weighting_scheme(), operator=(), register_lat_long_metric(), register_match_spy(), register_posting_source(), and register_weighting_scheme().