QueueAccessFile Class Reference

Access free portions of a file in blocks. More...

#include <QueueAccessFile.h>

Inheritance diagram for QueueAccessFile:
FileIO ConsecutiveReadQueueAccessFile ReadQueueAccessFile WriteQueueAccessFile

List of all members.

Public Member Functions

 QueueAccessFile (const char *filename, std::ios::openmode mode)
 Initialise the class with a file name and access mode.
 QueueAccessFile (const char *filename, std::ios::openmode mode, FileBlockQueue *sQueue, FileBlockQueue *uQueue)
 Initialise the class with file details and access queues sQueue showing free blocks and uQueue containing used blocks.
 QueueAccessFile (const char *filename, std::ios::openmode mode, FileBlockQueue *uQueue)
 Initialise the class with file details and access queue uQueue containing used blocks.
virtual void nextFileBlock (char *buffer, int blockSize)=0
 Process the next file block using the given buffer and block size.
void addQueue (FileBlockQueue *fQueue)
 Add the contents of fQueue to the spare file block queue.
void addFreeBlock (FILE_POS_TYPE position)
 Add the file position to the back of the spare queue.
FileBlockQueueusedBlocks (void)
 Return the number of used blocks in the file.
FILE_POS_TYPE usedFileBytes (void)
 Return the number of used bytes in the file.
void segmentAccesses (long segment, FILE_POS_TYPE start, FILE_POS_TYPE end)
 Add the continous file region from start to end to the spare queue in segment sized blocks.
void segmentAccesses (long segment, FILE_POS_TYPE start)
 Add the continous file region from start to the end of the file to the spare queue in segment sized blocks.

Protected Attributes

FileBlockQueuespareQueue
 The spare quere containing the free blocks.
FileBlockQueueusedQueue
 The used queue containing the processed blocks.
FILE_POS_TYPE usedBytes
 The number of used bytes in the file.

Detailed Description

Access free portions of a file in blocks.

This class is used to access a file using FileIO in blocks. Queues are maintained to keep track of which parts of the file are available for processing and which parts have been processed. By doing this, multiple QueueAccessFiles can have access to the same file as long as they all report to each other which blocks are availble and which are not.

Author
lapark
Revision
1.4.2.1
Date
2009/11/09 13:13:42
Id
QueueAccessFile.h,v 1.4.2.1 2009/11/09 13:13:42 lapark Exp

The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends

Generated on Tue Nov 10 14:12:16 2009 for textIR by  doxygen 1.6.1