ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
io
mmap_file.h
Go to the documentation of this file.
1
10
#ifndef META_MMAP_FILE_H_
11
#define META_MMAP_FILE_H_
12
13
#include <stdexcept>
14
#include <string>
15
16
namespace
meta
17
{
18
namespace
io
19
{
20
24
class
mmap_file
25
{
26
public
:
31
mmap_file
(
const
std::string&
path
);
32
36
mmap_file
(
mmap_file
&&);
37
41
mmap_file
&
operator=
(
mmap_file
&&);
42
47
~mmap_file
();
48
54
char
operator[]
(uint64_t index)
const
;
55
59
uint64_t
size
()
const
;
60
65
std::string
path
()
const
;
66
70
char
*
begin
()
const
;
71
72
private
:
74
std::string
path_
;
75
77
char
*
start_
;
78
80
uint64_t
size_
;
81
83
int
file_descriptor_
;
84
86
mmap_file
(
const
mmap_file
& other) =
delete
;
87
89
const
mmap_file
&
operator=
(
const
mmap_file
& other) =
delete
;
90
91
public
:
95
class
mmap_file_exception
:
public
std::runtime_error
96
{
97
public
:
98
using
std::runtime_error::runtime_error;
99
};
100
};
101
}
102
}
103
104
#endif
meta::io::mmap_file::begin
char * begin() const
Definition:
mmap_file.cpp:53
meta::io::mmap_file::path_
std::string path_
Filename of the text file.
Definition:
mmap_file.h:74
meta::io::mmap_file::size
uint64_t size() const
Definition:
mmap_file.cpp:76
meta::io::mmap_file
Memory maps a text file readonly.
Definition:
mmap_file.h:24
meta::io::mmap_file::file_descriptor_
int file_descriptor_
File descriptor for the open text file.
Definition:
mmap_file.h:83
meta::io::mmap_file::operator=
mmap_file & operator=(mmap_file &&)
Move assignment operator.
Definition:
mmap_file.cpp:58
meta::io::mmap_file::~mmap_file
~mmap_file()
Destructor; deallocates memory used to store this object, closing the text file.
Definition:
mmap_file.cpp:86
meta
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
meta::io::mmap_file::path
std::string path() const
Definition:
mmap_file.cpp:81
meta::io::mmap_file::mmap_file
mmap_file(const std::string &path)
Constructor.
Definition:
mmap_file.cpp:19
meta::io::mmap_file::start_
char * start_
Pointer to the beginning of the text file.
Definition:
mmap_file.h:77
meta::io::mmap_file::size_
uint64_t size_
Size of the current text file.
Definition:
mmap_file.h:80
meta::io::mmap_file::operator[]
char operator[](uint64_t index) const
Definition:
mmap_file.cpp:45
meta::io::mmap_file::mmap_file_exception
Basic exception for mmap_file interactions.
Definition:
mmap_file.h:95
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1