JASSv2
serialise_ci.h
Go to the documentation of this file.
1 /*
2  SERIALISE_CI.H
3  --------------
4  Copyright (c) 2017 Andrew Trotman
5  Released under the 2-clause BSD license (See:https://en.wikipedia.org/wiki/BSD_licenses)
6  */
13 #pragma once
14 
15 #include "file.h"
16 #include "index_manager.h"
17 
18 namespace JASS
19  {
20  /*
21  CLASS SERIALISE_CI
22  ------------------
23  */
31  {
32  private:
37  uint64_t terms;
38 
39  public:
40  serialise_ci() = delete;
41  /*
42  SERIALISE_CI::SERIALISE_CI()
43  ----------------------------
44  */
49  serialise_ci(size_t documents);
50 
51  /*
52  SERIALISE_CI::~SERIALISE_CI()
53  -----------------------------
54  */
59  {
60  }
61 
62  /*
63  SERIALISE_CI::FINISH()
64  ----------------------
65  */
69  void finish(void);
70 
71  /*
72  SERIALISE_CI::DELEGATE::OPERATOR()()
73  ------------------------------------
74  */
83  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);
84 
85  /*
86  SERIALISE_CI::DELEGATE::OPERATOR()()
87  ------------------------------------
88  */
94  virtual void operator()(size_t document_id, const slice &primary_key);
95 
96  /*
97  SERIALISE_CI::UNITTEST()
98  ------------------------
99  */
103  static void unittest(void);
104  };
105  }
Non-thread-safe object that accumulates a single postings list during indexing.
Definition: index_postings.h:40
~serialise_ci()
Definition: serialise_ci.h:58
file postings_header_file
The header file for the postings file (so that the vocab can point to the methods) ...
Definition: serialise_ci.h:34
C++ slices (string-descriptors)
Definition: slice.h:27
Base class for the indexer object that stored the actual index during indexing.
uint32_t integer
This class and descendants will work on integers of this size. Do not change without also changing JA...
Definition: compress_integer.h:40
file primary_key_file
The list of primary keys.
Definition: serialise_ci.h:36
Partial file and whole file based I/O methods.
static void unittest(void)
Unit test this class.
Definition: serialise_ci.cpp:133
file vocab_file
The vocabulary file (also know as the dictionary file)
Definition: serialise_ci.h:35
uint64_t terms
The number of terms in the vocabulary file.
Definition: serialise_ci.h:37
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().
Definition: serialise_ci.cpp:78
Definition: document_id.h:16
uint16_t impact_type
An impact value (i.e. a term frequency value) is of this type.
Definition: index_postings_impact.h:41
size_t documents
The number of documents in the collection.
Definition: index_manager.h:50
File based I/O methods including whole file and partial files.
Definition: file.h:45
Base class for the callback function called by iterate.
Definition: index_manager.h:47
Definition: compress_integer_elias_delta_simd.c:23
file postings_file
The postings file.
Definition: serialise_ci.h:33
Serialse an index into source files for use with JASS_compiled_index.cpp.
Definition: serialise_ci.h:30
void finish(void)
Do any final cleaning up.
Definition: serialise_ci.cpp:59