Xapian::MultiValueSorter Class Reference

Sorter subclass which sorts by a several values. More...

#include <keymaker.h>

Inheritance diagram for Xapian::MultiValueSorter:

Inheritance graph
[legend]
Collaboration diagram for Xapian::MultiValueSorter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MultiValueSorter ()
template<class Iterator >
 MultiValueSorter (Iterator begin, Iterator end)
virtual std::string operator() (const Xapian::Document &doc) const
 Build a key string for a Document.
void add (Xapian::valueno slot, bool forward=true)

Private Attributes

std::vector< std::pair
< Xapian::valueno, bool > > 
slots


Detailed Description

Sorter subclass which sorts by a several values.

Results are ordered by the first value. In the event of a tie, the second is used. If this is the same for both, the third is used, and so on.

Deprecated:
This class is deprecated - you should migrate to using MultiValueKeyMaker instead. Note that MultiValueSorter::add() becomes MultiValueKeyMaker::add_value(), but the sense of the direction flag is reversed (to be consistent with Enquire::set_sort_by_value()), so:
MultiValueSorter sorter; // Primary ordering is forwards on value 4. sorter.add(4); // Secondary ordering is reverse on value 5. sorter.add(5, false);

becomes:

MultiValueKeyMaker sorter; // Primary ordering is forwards on value 4. sorter.add_value(4); // Secondary ordering is reverse on value 5. sorter.add_value(5, true);

Definition at line 111 of file keymaker.h.


Constructor & Destructor Documentation

Xapian::MultiValueSorter::MultiValueSorter (  )  [inline]

Definition at line 115 of file keymaker.h.

template<class Iterator >
Xapian::MultiValueSorter::MultiValueSorter ( Iterator  begin,
Iterator  end 
) [inline]

Definition at line 118 of file keymaker.h.


Member Function Documentation

void Xapian::MultiValueSorter::add ( Xapian::valueno  slot,
bool  forward = true 
) [inline]

Definition at line 124 of file keymaker.h.

Referenced by DEFINE_TESTCASE().

string Xapian::MultiValueSorter::operator() ( const Xapian::Document doc  )  const [virtual]

Build a key string for a Document.

These keys can be used for sorting or collapsing matching documents.

Parameters:
doc Document object to build a key for.

Implements Xapian::KeyMaker.

Definition at line 101 of file keymaker.cc.

References Xapian::Document::get_value(), rare, and slots.


Member Data Documentation

std::vector<std::pair<Xapian::valueno, bool> > Xapian::MultiValueSorter::slots [private]

Definition at line 112 of file keymaker.h.

Referenced by operator()().


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

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.