A queue datastructure, which validates parts of a VHIST file.
More...
#include <validationqueue.h>
List of all members.
Public Slots |
void | cancelValidation () |
| Stops the validation and removes all validatees from the queue.
|
Signals |
void | fileProcessed (int id, bool valid) |
| This signal is emitted each time a file has been completely processed.
|
void | savedFileProcessed (const QString filename, bool valid) |
| This signal is emitted each time a file on the harddisk has been completely processed.
|
void | sectionProcessed (int id, bool valid) |
| This signal is emitted each time a file has been completely processed.
|
void | percentFinishedChanged (int, const QString name) |
| This signal is emitted each time the percentage of validated data in the queue changes.
|
Public Member Functions |
| ValidationQueue (VhistParser *parser=NULL, int chunksize=100000) |
| Creates a ValidationQueue object.
|
virtual | ~ValidationQueue () |
| Destroys the ValidationQueue object.
|
void | reset (VhistParser *parser) |
| Clears and reinitializes the ValidationQueue.
|
void | repopulate (VhistParser *parser) |
| Resets the ValidationQueue and enqueues all files and sections from the given parser.
|
void | addValidatees (QList< int > files, QList< int > sections) |
| Adds a list of files and sections to the validation queue.
|
void | addValidatees (QList< SavedFile > files) |
| Adds a list of files in the filesystem to the validation queue.The files are characterized by their filenames, their filesize and the expected md5 sum.
|
bool | process () |
| Continues processing entries in the queue.
|
Detailed Description
A queue datastructure, which validates parts of a VHIST file.
Sections and files can be enqueued at the end of the queue and are validated one after another. Entries in the queue are not validated in one single (blocking) step but continuously. Each call to the process method will validate a small fraction of data and inform whether all files and sections in the queue have already been validated. Progress information is published by a number of signals. Each instance of the class uses one vhist::VhistParser instance as the source for embedded files and sections.
Constructor & Destructor Documentation
ValidationQueue::ValidationQueue |
( |
VhistParser * |
parser = NULL , |
|
|
int |
chunksize = 100000 |
|
) |
| |
Creates a ValidationQueue object.
- Parameters:
-
[in] | parser | The parser, who backs the validation queue. All files and sections are taken from this VhistParser object. Unless you only want to validate extracted files on your harddisk, parser should not be NULL . |
[in] | chunksize | The maximum amount of data in bytes which is processed during one call of ValidationQueue::process(). |
Member Function Documentation
void ValidationQueue::addValidatees |
( |
QList< int > |
fileIDs, |
|
|
QList< int > |
sectionIDs |
|
) |
| |
Adds a list of files and sections to the validation queue.
The files and sections are taken from the VhistParser object associated with the queue.
- Parameters:
-
[in] | fileIDs | A list of ids of embedded files in the associated VHIST file, which should be appended to the queue. |
[in] | sectionIDs | A list of ids of sections in the associated VHIST file, which should be appended to the queue. |
void ValidationQueue::addValidatees |
( |
QList< SavedFile > |
files | ) |
|
Adds a list of files in the filesystem to the validation queue.The files are characterized by their filenames, their filesize and the expected md5 sum.
- Parameters:
-
[in] | files | The list of files which should be added to the queue. |
void ValidationQueue::fileProcessed |
( |
int |
id, |
|
|
bool |
valid |
|
) |
| [signal] |
This signal is emitted each time a file has been completely processed.
- Parameters:
-
[in] | id | The id of the processed file. |
[in] | valid | true if the file's checksum is correct. |
void ValidationQueue::percentFinishedChanged |
( |
int |
percent, |
|
|
const QString |
filename |
|
) |
| [signal] |
This signal is emitted each time the percentage of validated data in the queue changes.
- Parameters:
-
[in] | percent | The percentage of data from the queue, which has already been validated. |
[in] | filename | The name of the file which is processed at the moment. |
bool ValidationQueue::process |
( |
| ) |
|
Continues processing entries in the queue.
The queue will only process a limited amount of data during one call. The size of each chunk can be specified in the constructor. Small sizes result in high responsiveness of
void ValidationQueue::repopulate |
( |
VhistParser * |
parser | ) |
|
Resets the ValidationQueue and enqueues all files and sections from the given parser.
- Parameters:
-
void ValidationQueue::savedFileProcessed |
( |
const QString |
filename, |
|
|
bool |
valid |
|
) |
| [signal] |
This signal is emitted each time a file on the harddisk has been completely processed.
- Parameters:
-
[in] | filename | The name of the processed file. |
[in] | valid | true if the files's checksum is correct. |
void ValidationQueue::sectionProcessed |
( |
int |
id, |
|
|
bool |
valid |
|
) |
| [signal] |
This signal is emitted each time a file has been completely processed.
- Parameters:
-
[in] | id | The id of the processed file. |
[in] | valid | true if the section's checksum is correct. |
The documentation for this class was generated from the following files:
- /daten/ahuesgen/projects/vhist/code/vhistlib/include/unvhistlib/validationqueue.h
- /daten/ahuesgen/projects/vhist/code/vhistlib/Debug/moc_validationqueue.cpp
- /daten/ahuesgen/projects/vhist/code/vhistlib/Debug64/moc_validationqueue.cpp
- /daten/ahuesgen/projects/vhist/code/vhistlib/Release/moc_validationqueue.cpp
- /daten/ahuesgen/projects/vhist/code/vhistlib/Release64/moc_validationqueue.cpp
- /daten/ahuesgen/projects/vhist/code/vhistlib/src/unvhistlib/validationqueue.cpp