JASSv2
Public Member Functions | Private Attributes | List of all members
JASS::index_manager_sequential::delegate Class Reference

Base class for the callback function called by iterate. More...

#include <index_manager_sequential.h>

Inheritance diagram for JASS::index_manager_sequential::delegate:
Inheritance graph
[legend]
Collaboration diagram for JASS::index_manager_sequential::delegate:
Collaboration graph
[legend]

Public Member Functions

 delegate (size_t documents_in_collection, std::ostream &postings, std::ostream &primary_keys)
 Constructor. More...
 
virtual void finish (void)
 Any final clean up.
 
virtual ~delegate ()
 Destructor.
 
virtual void operator() (const slice &term, const index_postings &postings, compress_integer::integer document_frequency, compress_integer::integer *document_ids, index_postings_impact::impact_type *term_frequencies)
 The callback function to serialise the postings (given the term) is operator(). More...
 
virtual void operator() (size_t document_id, const slice &primary_key)
 The callback function to serialise the primary keys (external document ids) is operator(). More...
 
- Public Member Functions inherited from JASS::index_manager::delegate
 delegate (size_t documents)
 Destructor.
 

Private Attributes

std::ostream & postings_out
 The unit test iterates into this.
 
std::ostream & primary_keys_out
 The unit test iterates into this.
 

Additional Inherited Members

- Public Attributes inherited from JASS::index_manager::delegate
size_t documents
 The number of documents in the collection.
 

Detailed Description

Base class for the callback function called by iterate.

Constructor & Destructor Documentation

◆ delegate()

JASS::index_manager_sequential::delegate::delegate ( size_t  documents_in_collection,
std::ostream &  postings,
std::ostream &  primary_keys 
)
inline

Constructor.

Parameters
documents_in_collection[in] The total number of documents in the collection
postings[out] data is written into this object.
primary_keys[in] primary key data is ertten into this object.

Member Function Documentation

◆ operator()() [1/2]

virtual void JASS::index_manager_sequential::delegate::operator() ( const slice term,
const index_postings postings,
compress_integer::integer  document_frequency,
compress_integer::integer document_ids,
index_postings_impact::impact_type term_frequencies 
)
inlinevirtual

The callback function to serialise the postings (given the term) is operator().

Parameters
term[in] The term name.
postings[in] The postings lists.
document_frequency[in] The documment frequency of term (the length of document_ids and term_frequencies).
document_ids[in] The array of document ids in which the term is found
term_frequencies[in] The number of occurences of the term in each document id in document_ids

Implements JASS::index_manager::delegate.

◆ operator()() [2/2]

virtual void JASS::index_manager_sequential::delegate::operator() ( size_t  document_id,
const slice primary_key 
)
inlinevirtual

The callback function to serialise the primary keys (external document ids) is operator().

Parameters
document_id[in] The internal document identfier.
primary_key[in] This document's primary key (external document identifier).

Implements JASS::index_manager::delegate.


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