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 #include "meta/config.h"
17 
18 namespace meta
19 {
20 namespace index
21 {
22 
29 template <class PrimaryKey, class SecondaryKey>
30 class chunk
31 {
32  public:
36  chunk(const std::string& path);
37 
43  bool operator<(const chunk& other) const;
44 
48  uint64_t size() const;
49 
53  std::string path() const;
54 
63  template <class Container>
64  void memory_merge_with(Container& pdata);
65 
66  private:
68  void set_size();
69 
71  std::string path_;
72 
74  uint64_t size_;
75 };
76 }
77 }
78 
79 #include "meta/index/chunk.tcc"
80 #endif
std::string path_
The path to this chunk file on disk.
Definition: chunk.h:71
uint64_t size_
The number of bytes this chunk takes up.
Definition: chunk.h:74
void memory_merge_with(Container &pdata)
Definition: chunk.tcc:50
bool operator<(const chunk &other) const
Definition: chunk.tcc:30
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retrieval, data mining, and other applications of text processing.
Definition: analyzer.h:25
chunk(const std::string &path)
Definition: chunk.tcc:17
void set_size()
Calculates the size of the file this chunk represents in bytes.
Definition: chunk.tcc:24
Represents a portion of a disk_index&#39;s postings file.
Definition: chunk.h:30
uint64_t size() const
Definition: chunk.tcc:43
std::string path() const
Definition: chunk.tcc:37