ModErn Text Analysis
META Enumerates Textual Applications
chunk.h
Go to the documentation of this file.
1 
10 #ifndef META_CHUNK_H_
11 #define META_CHUNK_H_
12 
13 #include <cstdint>
14 #include <string>
15 
16 namespace meta
17 {
18 namespace index
19 {
20 
27 template <class PrimaryKey, class SecondaryKey>
28 class chunk
29 {
30  public:
34  chunk(const std::string& path);
35 
41  bool operator<(const chunk& other) const;
42 
46  uint64_t size() const;
47 
51  std::string path() const;
52 
59  void merge_with(const chunk& other);
60 
69  template <class Container>
70  void memory_merge_with(Container& pdata);
71 
72  private:
74  void set_size();
75 
77  std::string path_;
78 
80  uint64_t size_;
81 };
82 }
83 }
84 
85 #include "index/chunk.tcc"
86 #endif
std::string path_
The path to this chunk file on disk.
Definition: chunk.h:77
uint64_t size_
The number of bytes this chunk takes up.
Definition: chunk.h:80
bool operator<(const chunk &other) const
Definition: chunk.tcc:32
void memory_merge_with(Container &pdata)
Definition: chunk.tcc:129
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
chunk(const std::string &path)
Definition: chunk.tcc:19
void set_size()
Calculates the size of the file this chunk represents in bytes.
Definition: chunk.tcc:26
void merge_with(const chunk &other)
After this function ends, the current chunk file will contain information from both chunks...
Definition: chunk.tcc:51
Represents a portion of a disk_index's postings file.
Definition: chunk.h:28
std::string path() const
Definition: chunk.tcc:39
uint64_t size() const
Definition: chunk.tcc:45