Holder class for an impact ordered postings list.
More...
#include <index_postings_impact.h>
|
| class | impact |
| | Each impact is represented as an impact score, and a start and end pointer. More...
|
| |
| class | reverse_iterator |
| | A reverse iterator for iterating over impact headers from highet to lowest. More...
|
| |
|
|
typedef uint16_t | impact_type |
| | An impact value (i.e. a term frequency value) is of this type.
|
| |
|
|
static void | unittest (void) |
| | Unit test this class.
|
| |
|
|
static constexpr size_t | largest_impact = 1024 |
| | The largest allowable immpact score (255 is an good value).
|
| |
|
static constexpr size_t | smallest_impact = 1 |
| | The smallest allowable impact score (normally 1)
|
| |
Holder class for an impact ordered postings list.
◆ index_postings_impact()
| JASS::index_postings_impact::index_postings_impact |
( |
size_t |
document_count, |
|
|
allocator & |
memory |
|
) |
| |
|
inline |
Constructor.
The postings lists are typvically stored <impact><d><d>...<d><0>, The headers point to the list of <d>s (not the <impact> or the <0>.
- Parameters
-
| document_count | [in] The number of documents in the collection (the length of the longest postings list) |
| memory | [in] All memory allocation happens in this arena |
◆ begin()
| const impact* JASS::index_postings_impact::begin |
( |
void |
| ) |
const |
|
inline |
Return a pointer to the first impact header (for use in an iterator).
- Returns
- A pointer to the first impact header.
◆ end()
| const impact* JASS::index_postings_impact::end |
( |
void |
| ) |
const |
|
inline |
Return a pointer to one element past the end of the impact headers (for use in an iterator).
- Returns
- A pointer to one element past the end of the impact headers.
◆ get_postings()
Return a pointer to the buffer containing the postings.
This method should only be called by a method that builds one of these objects.
◆ header()
Set the value of the impact header object at the given index.
- Parameters
-
| index | [in] Which header to set |
| score | [in] The impact value for all the documents in this range |
| postings_start | [in] The start of the range of postings that share this impact score |
| postings_end | [in] The end of the range if postings that share this impact score |
◆ impact_size()
| size_t JASS::index_postings_impact::impact_size |
( |
void |
| ) |
const |
|
inline |
Return the number of unique impact scores in the postings list.
The number of unique impact scores.
◆ operator[]()
return a reference to the size_t at position index in the postings array.
Node taht this is astrict index and not range checked. Access out of range ill resilt in undefined behaviour. The access is to elements in the array so if the postings are stored <impact><d><d>...<d><0> then posting[0] will be the impact score.
- Returns
- a reference to the size_t at postng[index].
◆ rbegin()
| const auto JASS::index_postings_impact::rbegin |
( |
void |
| ) |
const |
|
inline |
Return a pointer to the last impact header (for use in an reverse iterator).
- Returns
- A pointer to the first impact header.
◆ rend()
| const auto JASS::index_postings_impact::rend |
( |
void |
| ) |
const |
|
inline |
Return a pointer to one element before the first impact headers (for use in reverse iteration iterator).
- Returns
- A pointer to one element past the end of the impact headers.
◆ set_impact_count()
| void JASS::index_postings_impact::set_impact_count |
( |
size_t |
number_of_impacts | ) |
|
|
inline |
Tell this object how many impacts it holds.
This method should only be called by a method that builds one of these objects.
- Parameters
-
| number_of_impacts | [in] The number of impact segments this object holds |
◆ text_render()
| void JASS::index_postings_impact::text_render |
( |
std::ostream & |
stream | ) |
|
|
inline |
Dump a human-readable version of the postings list down the stream.
- Parameters
-
| stream | [in] The stream to write to. |
The documentation for this class was generated from the following file: