54 default_allocator(default_allocation_size),
55 primary_key_allocator(default_allocator),
56 contents_allocator(default_allocator)
71 primary_key_allocator(default_allocator),
72 contents_allocator(memory_source)
89 return contents.
size() == 0;
101 primary_key =
slice();
103 contents_allocator.
rewind();
104 primary_key_allocator.
rewind();
120 puts(
"document::PASSED");
C++ slices (string-descriptors)
Definition: slice.h:27
Container class representing a document through the indexing pipeline.
Definition: document.h:31
static const size_t default_allocation_size
The default size of the allocation unit within the document.
Definition: document.h:34
document()
Constructor using an allocator local to this object (useful when the object needs to contain its own ...
Definition: document.h:53
slice primary_key
The external primary key (e.g. TREC DOCID, or filename) of the document (or empty if that is meaningl...
Definition: document.h:42
static void unittest(void)
Unit test this class.
Definition: document.h:114
void rewind(void)
Free up all resources assocuated with this object and make it ready for re-use.
Definition: document.h:99
bool isempty(void)
Check to see whether this is an empty document.
Definition: document.h:87
slice contents
The contents of the document (or likewise).
Definition: document.h:43
Simple block-allocator that internally allocates a large chunk then allocates smaller blocks from thi...
Definition: allocator_pool.h:61
Virtual base class for C style allocators.
Definition: allocator.h:33
virtual void rewind(void)=0
Throw away (without calling delete) all objects allocated in the memory space of this allocator Delet...
document(class allocator &memory_source)
Constructor using an allocator specified (useful when the object needs to allocate memory in a specif...
Definition: document.h:70
Simple block-allocator that internally allocates a large chunk then allocates smaller blocks from thi...
Slices (also known as string-descriptors) for C++.
allocator_pool default_allocator
If a document is created without a specified allocator then use a pool allocator. ...
Definition: document.h:37
allocator & contents_allocator
If memory is needed for the document contents then allocate from here.
Definition: document.h:41
Definition: compress_integer_elias_delta_simd.c:23
size_t size(void) const
Return the length of this slice.
Definition: slice.h:256
allocator & primary_key_allocator
If memory is needed for the primary key then allocate from here.
Definition: document.h:40