HOG2
|
#include <DiskBitFile.h>
Public Member Functions | |
DiskBitFile (const char *pre) | |
~DiskBitFile () | |
void | Init (const std::vector< bucketData > &buckets) |
void | WriteFileDepth (int bucket, int64_t offset, uint8_t value) |
int | ReadFileDepth (int bucket, int64_t offset) |
void | CloseReadWriteFile () |
uint8_t * | ReadChunk (int bucket, int64_t offset, int numEntries, uint8_t *data) |
void | CloseReadFile () |
uint64_t | GetBytesRead () const |
uint64_t | GetBytesWritten () const |
Private Member Functions | |
void | FlushCache () |
const char * | getBucketFileName (int bucket, int subBucket) |
Private Attributes | |
FILE * | outputFile |
int | outputBucket |
int | outputSubBucket |
int64_t | cacheOffset |
bool | fileOpen |
FILE * | chunkFile |
int64_t | fileOffset |
int64_t | currBucket |
int64_t | currSubBucket |
int64_t | theCacheSize |
int64_t | cacheFilePosition |
bool | cacheChanged |
uint8_t | cache [cacheSize] |
uint64_t | bytesRead |
uint64_t | bytesWritten |
char | bucketFileName [255] |
char | prefix [64] |
Static Private Attributes | |
const static int | subBucketBits = 30 |
const static int64_t | cacheSize = 1ull<<22 |
Definition at line 23 of file DiskBitFile.h.
DiskBitFile::DiskBitFile | ( | const char * | pre | ) |
Definition at line 11 of file DiskBitFile.cpp.
References bytesRead, bytesWritten, cacheChanged, cacheFilePosition, cacheOffset, chunkFile, currBucket, currSubBucket, fileOffset, fileOpen, outputBucket, outputFile, outputSubBucket, prefix, and theCacheSize.
DiskBitFile::~DiskBitFile | ( | ) |
Definition at line 35 of file DiskBitFile.cpp.
References CloseReadFile(), and CloseReadWriteFile().
void DiskBitFile::CloseReadFile | ( | ) |
Definition at line 197 of file DiskBitFile.cpp.
References chunkFile, and fileOpen.
Referenced by ~DiskBitFile().
void DiskBitFile::CloseReadWriteFile | ( | ) |
Definition at line 41 of file DiskBitFile.cpp.
References cacheFilePosition, cacheOffset, outputBucket, outputFile, and outputSubBucket.
Referenced by ReadFileDepth(), WriteFileDepth(), and ~DiskBitFile().
|
private |
Definition at line 260 of file DiskBitFile.cpp.
References bytesWritten, cache, cacheChanged, cacheFilePosition, cacheOffset, outputFile, and theCacheSize.
Referenced by ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 311 of file DiskBitFile.cpp.
References BITS, bucketFileName, and prefix.
Referenced by Init(), ReadChunk(), ReadFileDepth(), and WriteFileDepth().
|
inline |
Definition at line 38 of file DiskBitFile.h.
References bytesRead.
|
inline |
Definition at line 39 of file DiskBitFile.h.
References bytesWritten.
void DiskBitFile::Init | ( | const std::vector< bucketData > & | buckets | ) |
Definition at line 275 of file DiskBitFile.cpp.
References BITS, currSubBucket, getBucketFileName(), min(), and subBucketBits.
uint8_t * DiskBitFile::ReadChunk | ( | int | bucket, |
int64_t | offset, | ||
int | numEntries, | ||
uint8_t * | data | ||
) |
Definition at line 208 of file DiskBitFile.cpp.
References BITS, bytesRead, chunkFile, currBucket, currSubBucket, fileOffset, fileOpen, getBucketFileName(), and subBucketBits.
int DiskBitFile::ReadFileDepth | ( | int | bucket, |
int64_t | offset | ||
) |
Definition at line 115 of file DiskBitFile.cpp.
References BITS, bytesRead, cache, cacheFilePosition, cacheOffset, cacheSize, CloseReadWriteFile(), FlushCache(), getBucketFileName(), outputBucket, outputFile, outputSubBucket, subBucketBits, and theCacheSize.
Referenced by RubiksCube::Edge12PDBDist().
void DiskBitFile::WriteFileDepth | ( | int | bucket, |
int64_t | offset, | ||
uint8_t | value | ||
) |
Definition at line 56 of file DiskBitFile.cpp.
References BITS, cache, cacheChanged, cacheFilePosition, cacheOffset, CloseReadWriteFile(), FlushCache(), getBucketFileName(), outputBucket, outputFile, outputSubBucket, subBucketBits, and theCacheSize.
|
private |
Definition at line 65 of file DiskBitFile.h.
Referenced by getBucketFileName().
|
private |
Definition at line 64 of file DiskBitFile.h.
Referenced by DiskBitFile(), GetBytesRead(), ReadChunk(), and ReadFileDepth().
|
private |
Definition at line 64 of file DiskBitFile.h.
Referenced by DiskBitFile(), FlushCache(), and GetBytesWritten().
|
private |
Definition at line 62 of file DiskBitFile.h.
Referenced by FlushCache(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 61 of file DiskBitFile.h.
Referenced by DiskBitFile(), FlushCache(), and WriteFileDepth().
|
private |
Definition at line 60 of file DiskBitFile.h.
Referenced by CloseReadWriteFile(), DiskBitFile(), FlushCache(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 48 of file DiskBitFile.h.
Referenced by CloseReadWriteFile(), DiskBitFile(), FlushCache(), ReadFileDepth(), and WriteFileDepth().
|
staticprivate |
Definition at line 58 of file DiskBitFile.h.
Referenced by ReadFileDepth().
|
private |
Definition at line 52 of file DiskBitFile.h.
Referenced by CloseReadFile(), DiskBitFile(), and ReadChunk().
|
private |
Definition at line 54 of file DiskBitFile.h.
Referenced by DiskBitFile(), and ReadChunk().
|
private |
Definition at line 55 of file DiskBitFile.h.
Referenced by DiskBitFile(), Init(), and ReadChunk().
|
private |
Definition at line 53 of file DiskBitFile.h.
Referenced by DiskBitFile(), and ReadChunk().
|
private |
Definition at line 51 of file DiskBitFile.h.
Referenced by CloseReadFile(), DiskBitFile(), and ReadChunk().
|
private |
Definition at line 46 of file DiskBitFile.h.
Referenced by CloseReadWriteFile(), DiskBitFile(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 45 of file DiskBitFile.h.
Referenced by CloseReadWriteFile(), DiskBitFile(), FlushCache(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 47 of file DiskBitFile.h.
Referenced by CloseReadWriteFile(), DiskBitFile(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 66 of file DiskBitFile.h.
Referenced by DiskBitFile(), and getBucketFileName().
|
staticprivate |
Definition at line 57 of file DiskBitFile.h.
Referenced by Init(), ReadChunk(), ReadFileDepth(), and WriteFileDepth().
|
private |
Definition at line 59 of file DiskBitFile.h.
Referenced by DiskBitFile(), FlushCache(), ReadFileDepth(), and WriteFileDepth().