#include <abstractdiskio.h>
Public Slots | |
void | readDataSet () |
Read one dataset from the file. | |
void | readNDataSets (int) |
Read N datasets from the file. | |
void | readTenDataSets () |
Read ten datasets from the file. | |
void | readHundredDataSets () |
Read 100 datasets from the file. | |
void | readAllDataSets () |
Read datasets from the file until the end of the file is reached. | |
virtual void | reset ()=0 |
Go back to start. | |
virtual void | setFile (QString filename)=0 |
void | stopReading () |
Signals | |
void | readDataSets (int) |
the number of datasets read since the last call to setFile() | |
Public Member Functions | |
AbstractReader (QObject *) | |
normal constructor | |
~AbstractReader () | |
normal destructor | |
virtual QString | filter () const =0 |
The file-endings supported. | |
virtual QString | filename () const =0 |
the current filename | |
virtual bool | atEnd () const =0 |
whether the end is reached... | |
bool | reading () const |
Is the current state of type Reading? | |
QVariant | guiIdentifier (int) const |
GUI: return different types of data used to identify the treeitem. | |
Protected Member Functions | |
virtual void | readSingleDataSet ()=0 |
the real work | |
QString | debug () const |
Custom debug text. | |
Protected Attributes | |
NSCore::NamedParameterTreeItemPointer | config |
Private Slots | |
void | privateReadPendingDataSets () |
void | privateLateInit () |
Private Member Functions | |
QDomNode | saveToXML (QDomDocument) |
Store the information of this element into a new QDomElement. | |
bool | restoreFromXML (QDomNode) |
Restore the state of this element from the given QDomNode. | |
Private Attributes | |
int | _datasetsToRead |
int | _datasetsWritten |
QTimer * | _timer |
This provides a lot of functions to read datasets from disk, the only thing that is not done in this class is the actual reading...
You have to implement readSingleDataSet() where you read the data.
NSDiskIO::AbstractReader::AbstractReader | ( | QObject * | ) |
normal constructor
NSDiskIO::AbstractReader::~AbstractReader | ( | ) |
normal destructor
virtual QString NSDiskIO::AbstractReader::filter | ( | ) | const [pure virtual] |
The file-endings supported.
Implemented in NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
virtual QString NSDiskIO::AbstractReader::filename | ( | ) | const [pure virtual] |
the current filename
Implemented in NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
virtual bool NSDiskIO::AbstractReader::atEnd | ( | ) | const [pure virtual] |
whether the end is reached...
Implemented in NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
bool NSDiskIO::AbstractReader::reading | ( | ) | const [inline] |
QVariant NSDiskIO::AbstractReader::guiIdentifier | ( | int | role | ) | const [virtual] |
GUI: return different types of data used to identify the treeitem.
Things like the name, icon, statustip, tooltip and so on will be accessed by this.
role | is actually a combination of Qt::ItemDataRole |
Reimplemented from NSCore::QTreeItem.
void NSDiskIO::AbstractReader::readDataSet | ( | ) | [slot] |
Read one dataset from the file.
void NSDiskIO::AbstractReader::readNDataSets | ( | int | ) | [slot] |
Read N datasets from the file.
void NSDiskIO::AbstractReader::readTenDataSets | ( | ) | [slot] |
Read ten datasets from the file.
void NSDiskIO::AbstractReader::readHundredDataSets | ( | ) | [slot] |
Read 100 datasets from the file.
void NSDiskIO::AbstractReader::readAllDataSets | ( | ) | [slot] |
Read datasets from the file until the end of the file is reached.
virtual void NSDiskIO::AbstractReader::reset | ( | ) | [pure virtual, slot] |
Go back to start.
Don't collect the money and don't drink any champaign...
Implemented in NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
virtual void NSDiskIO::AbstractReader::setFile | ( | QString | filename | ) | [pure virtual, slot] |
Implemented in NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
void NSDiskIO::AbstractReader::stopReading | ( | ) | [inline, slot] |
References _datasetsToRead.
virtual void NSDiskIO::AbstractReader::readSingleDataSet | ( | ) | [protected, pure virtual] |
the real work
Implement this! Read one complete NSCore::AcqisitionDataSet from _stream and enqueue it to the buffer. You don't need to call signalData() as this will be done by the callers of this function.
This function will only be called when a file is open but it doesn't hurt to check _stream!=0 in the beginning.
You should emit percent( int ) regularly so the GUI and the user get informed about how much data i already read.
Implemented in NSDiskIO::AcqirisLiveReader, NSDiskIO::EPOSReader, NSDiskIO::EPOSBinReader, NSDiskIO::PragReader, and GageReader.
QString NSDiskIO::AbstractReader::debug | ( | ) | const [inline, protected, virtual] |
Custom debug text.
This function has to be implemented and has to return the internal debug-data that is to be printed...
Implements NSCore::QTreeItem.
void NSDiskIO::AbstractReader::readDataSets | ( | int | ) | [signal] |
the number of datasets read since the last call to setFile()
void NSDiskIO::AbstractReader::privateReadPendingDataSets | ( | ) | [private, slot] |
void NSDiskIO::AbstractReader::privateLateInit | ( | ) | [private, slot] |
QDomNode NSDiskIO::AbstractReader::saveToXML | ( | QDomDocument | doc | ) | [private, virtual] |
Store the information of this element into a new QDomElement.
This function is only to save the state of this element, all the recursive stuff will be done by toXml().
doc | The QDomDocument to use for creation of the element |
Implements NSCore::QTreeItem.
bool NSDiskIO::AbstractReader::restoreFromXML | ( | QDomNode | node | ) | [private, virtual] |
Restore the state of this element from the given QDomNode.
You don't have to do the recursive stuff here, that is handled in fromXml() for you. Only the things done in saveToXML need/can be restored here.
If you succeeded and want the childs to be restored too, return true.
node | The QDomNode to restore from |
Implements NSCore::QTreeItem.
int NSDiskIO::AbstractReader::_datasetsToRead [private] |
Referenced by reading(), and stopReading().
int NSDiskIO::AbstractReader::_datasetsWritten [private] |
QTimer* NSDiskIO::AbstractReader::_timer [private] |