Tanl Linguistic Pipeline |
An instance of this class is used to access either the word, stop-word, file, or meta-name index portions of an index file. More...
#include <IndexTable.h>
Classes | |
class | const_iterator |
Public Types | |
typedef Size | size_type |
typedef ptrdiff_t | difference_type |
typedef Entry | value_type |
typedef Entry * | pointer |
typedef Entry const * | const_pointer |
typedef Entry & | reference |
typedef Entry const & | const_reference |
Public Member Functions | |
IndexTable (mappedFile const &file, index_id id) | |
Prepare for accessing an index table beyond the column tables. | |
void | access (mappedFile const &file, off32_t &offset) |
Prepare for accessing the mapped memory by setting variables to the proper positions within the index file. | |
size_type | size () const |
const_pointer | operator[] (size_type i) const |
Get the entry at position. | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | position_at (size_type i) const |
Protected Attributes | |
mappedFile::const_iterator | begin_ |
size_type | entries |
Entry const * | table |
Friends | |
class | IndexTable::const_iterator |
An instance of this class is used to access either the word, stop-word, file, or meta-name index portions of an index file.
The file layout is as follows:
Count num_entries; off32_t entry_offset[num_entries]; off32_t entries_size; (entries)
By implementing fully-blown random access iterators for it, the STL algorithms work, in particular binary_search() and equal_range() that are used to do look ups.
IXE::IndexTable< Entry >::IndexTable | ( | mappedFile const & | file, | |
index_id | id | |||
) | [inline] |
Prepare for accessing an index table beyond the column tables.
References IXE::IndexTable< Entry >::access().
void IXE::IndexTable< Entry >::access | ( | mappedFile const & | file, | |
off32_t & | offset | |||
) | [inline] |
Prepare for accessing the mapped memory by setting variables to the proper positions within the index file.
Advance the offset to past the index table, skipping the data: the size of data is stored just after the table.
Referenced by IXE::IndexTable< Entry >::IndexTable().
const_pointer IXE::IndexTable< Entry >::operator[] | ( | size_type | i | ) | const [inline] |
Get the entry at position.
i | the position |
Reimplemented in IXE::BigramTable, and IXE::StringTable.