BusBoy
2
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
cpp
api
external
ExternalRandomAccessFile.h
Go to the documentation of this file.
1
17
#ifndef __BUSBOY_EXTERNAL_RANDOM_ACCESS_FILE_H__
18
#define __BUSBOY_EXTERNAL_RANDOM_ACCESS_FILE_H__
19
20
#include <mutex>
21
#include "
dataset/dataset_api.h
"
22
23
namespace
BUSBOY {
24
25
class
ExternalRandomAccessFileImpl;
26
27
class
ExternalRandomAccessFile
:
public
virtual
RandomAccessFile
{
28
29
public
:
30
31
ExternalRandomAccessFile
(
const
CExternalRandomAccessFileCallbacks
& callbacks);
32
33
size_t
read
(
char
* buf,
size_t
num);
34
35
size_t
getLocation
();
36
37
void
setLocation
(
size_t
loc);
38
39
void
setLocationFromEnd
(
size_t
loc);
40
41
void
skipForward
(
size_t
num);
42
43
void
skipBackward
(
size_t
num);
44
45
size_t
getFileSize
();
46
47
void
close
();
48
49
bool
isClosed
()
const
;
50
51
~ExternalRandomAccessFile
();
52
53
protected
:
54
55
void
assertNotClosed
()
const
;
56
57
std::unique_lock<std::mutex>
getLock
();
// So we can lock the same mutex in ExternalRandomAccessFileSink
58
59
const
CExternalRandomAccessFileCallbacks
&
getCallbacks
()
const
;
60
61
private
:
62
63
ExternalRandomAccessFileImpl
* m_impl;
64
65
// prevent calling these
66
ExternalRandomAccessFile
(
const
ExternalRandomAccessFile
& context);
67
ExternalRandomAccessFile
& operator=(
const
ExternalRandomAccessFile
& context);
68
69
70
71
72
};
73
74
}
75
76
#endif
77
78
79
Tue Nov 11 2014 23:19:41
1.8.3.1
Copyright 2014 Google Inc. All rights reserved.