#include <FeatureMultipleFileReader.h>


Public Member Functions | |
| FeatureMultipleFileReader (const XLine &l, const Config &, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage b=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) | |
| virtual | ~FeatureMultipleFileReader () |
| virtual bool | readFeature (Feature &f, unsigned long step=1) |
| virtual bool | writeFeature (const Feature &f, unsigned long step=1) |
| virtual unsigned long | getFeatureCount () |
| virtual unsigned long | getVectSize () |
| virtual const FeatureFlags & | getFeatureFlags () |
| virtual real_t | getSampleRate () |
| virtual void | close () |
| virtual unsigned long | getSourceCount () |
| virtual unsigned long | getFeatureCountOfASource (unsigned long srcIdx) |
| virtual unsigned long | getFeatureCountOfASource (const FileName &f) |
| virtual unsigned long | getFirstFeatureIndexOfASource (unsigned long srcIdx) |
| virtual unsigned long | getFirstFeatureIndexOfASource (const FileName &f) |
| virtual const String & | getNameOfASource (unsigned long srcIdx) |
| virtual String | getClassName () const |
| virtual String | toString () const |
Static Public Member Functions | |
| static FeatureMultipleFileReader & | create (const XLine &l, const Config &c, LabelServer *ls=NULL, BigEndian=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0) |
Private Member Functions | |
| FeatureFileReader ** | createReaderPtrVect () |
| FloatVector ** | createBufferPtrVect () |
| FeatureFileReader & | getReader (unsigned long idx) |
| bool | rw (bool, Feature &, unsigned long) |
| bool | featureWantedIsInHistoric (unsigned long n) const |
| bool | operator== (const FeatureMultipleFileReader &) const |
| bool | operator!= (const FeatureMultipleFileReader &) const |
| const FeatureMultipleFileReader & | operator= (const FeatureMultipleFileReader &) |
| FeatureMultipleFileReader (const FeatureMultipleFileReader &) | |
Private Attributes | |
| unsigned long | _fileCounter |
| const FeatureFileList | _fileList |
| BigEndian | _bigEndian |
| unsigned long | _fileCount |
| ULongVector | _readerStack |
| ULongVector | _memStack |
| FeatureFileReader ** | _readerPtrVect |
| FloatVector ** | _bufferPtrVect |
| unsigned long | _memUsed |
| bool | _featuresAreWritableDefined |
| unsigned long | _lastFeatureIndex |
Friends | |
| class | TestFeatureMultipleFileReader |
Convenient class for reading features from multiples files
Definition at line 88 of file FeatureMultipleFileReader.h.
| alize::FeatureMultipleFileReader::FeatureMultipleFileReader | ( | const XLine & | l, |
| const Config & | , | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | be = BIGENDIAN_AUTO, |
||
| BufferUsage | b = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) | [explicit] |
Create a new file reader to read features from a list of file
The files will be opened, read and closed one after the other. The order will be the same as the list order. For the user, it will be as if it was a single file.
| l | list of file to read |
| ls | address of a label server. can be NULL. |
| c | configuration to use |
| be | big endian ? Can be BIGENDIAN_AUTO, BIGENDIAN_TRUE or BIGENDIAN_FALSE |
| virtual alize::FeatureMultipleFileReader::~FeatureMultipleFileReader | ( | ) | [virtual] |
| alize::FeatureMultipleFileReader::FeatureMultipleFileReader | ( | const FeatureMultipleFileReader & | ) | [private] |
Not implemented
| virtual void alize::FeatureMultipleFileReader::close | ( | ) | [virtual] |
Closes all the opened files
Implements alize::FeatureInputStream.
| static FeatureMultipleFileReader& alize::FeatureMultipleFileReader::create | ( | const XLine & | l, |
| const Config & | c, | ||
| LabelServer * | ls = NULL, |
||
| BigEndian | = BIGENDIAN_AUTO, |
||
| BufferUsage | = BUFFER_AUTO, |
||
| unsigned long | bufferSize = 0, |
||
| HistoricUsage | = ALL_FEATURES, |
||
| unsigned long | historicSize = 0 |
||
| ) | [static] |
Create a new file reader to read features from a list of file
The files will be opened, read and closed one after the other. The order will be the same as the list order. For the user, it will be as if it was a single file.
| l | list of file to read |
| ls | address of a label server. can be NULL. |
| c | configuration to use |
| FloatVector** alize::FeatureMultipleFileReader::createBufferPtrVect | ( | ) | [private] |
| FeatureFileReader** alize::FeatureMultipleFileReader::createReaderPtrVect | ( | ) | [private] |
| bool alize::FeatureMultipleFileReader::featureWantedIsInHistoric | ( | unsigned long | n ) | const [private] |
| virtual String alize::FeatureMultipleFileReader::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getFeatureCount | ( | ) | [virtual] |
Returns the number of features in all the files
| FileNotFoundException | if one of the files does not exist |
| InvalidDataException | if one of the files is not valid |
| IOException | if something else goes wrong |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getFeatureCountOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the feature count of a feature file
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getFeatureCountOfASource | ( | const FileName & | f ) | [virtual] |
Returns the feature count of a feature file
| f | name of the file |
Implements alize::FeatureInputStream.
| virtual const FeatureFlags& alize::FeatureMultipleFileReader::getFeatureFlags | ( | ) | [virtual] |
Returns the feature flags of the files
| Exception | thrown if the file list is empty |
| FileNotFoundException | if one of the files does not exist |
| InvalidDataException | if one of the files is not valid |
| IOException | if something else goes wrong |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getFirstFeatureIndexOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the number of the first feature of a feature file
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getFirstFeatureIndexOfASource | ( | const FileName & | f ) | [virtual] |
Returns the number of the first feature of a feature file
| f | name of the file |
Implements alize::FeatureInputStream.
| virtual const String& alize::FeatureMultipleFileReader::getNameOfASource | ( | unsigned long | srcIdx ) | [virtual] |
Returns the a particular feature file
| srcIdx | index of the file |
Implements alize::FeatureInputStream.
| FeatureFileReader& alize::FeatureMultipleFileReader::getReader | ( | unsigned long | idx ) | [private] |
| virtual real_t alize::FeatureMultipleFileReader::getSampleRate | ( | ) | [virtual] |
Returns the sample rate of the files
| Exception | thrown if the file list is empty |
| FileNotFoundException | if one of the files does not exist |
| InvalidDataException | if one of the files is not valid |
| IOException | if something else goes wrong |
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getSourceCount | ( | ) | [virtual] |
Returns the number of files read by the reader
Implements alize::FeatureInputStream.
| virtual unsigned long alize::FeatureMultipleFileReader::getVectSize | ( | ) | [virtual] |
Returns the size of the vector inside the features of the files
| Exception | thrown if the file list is empty |
| FileNotFoundException | if one of the files does not exist |
| InvalidDataException | if one of the files is not valid |
| IOException | if something else goes wrong |
Implements alize::FeatureInputStream.
| bool alize::FeatureMultipleFileReader::operator!= | ( | const FeatureMultipleFileReader & | ) | const [private] |
Not implemented
| const FeatureMultipleFileReader& alize::FeatureMultipleFileReader::operator= | ( | const FeatureMultipleFileReader & | ) | [private] |
Not implemented
| bool alize::FeatureMultipleFileReader::operator== | ( | const FeatureMultipleFileReader & | ) | const [private] |
| virtual bool alize::FeatureMultipleFileReader::readFeature | ( | Feature & | f, |
| unsigned long | s = 1 |
||
| ) | [virtual] |
Reads a feature in the stream and move the pointer s step forward
| f | the feature to store the data read |
| s | step (default value = 1) |
| IOException | if an I/O error occurs |
Implements alize::FeatureInputStream.
| bool alize::FeatureMultipleFileReader::rw | ( | bool | , |
| Feature & | , | ||
| unsigned | long | ||
| ) | [private] |
| virtual String alize::FeatureMultipleFileReader::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
| virtual bool alize::FeatureMultipleFileReader::writeFeature | ( | const Feature & | f, |
| unsigned long | s = 1 |
||
| ) | [virtual] |
Writes a feature in the stream and move the pointer s step forward
| f | the feature to store the data read |
| s | step (default value = 1) |
| IOException | if an I/O error occurs |
Reimplemented from alize::FeatureInputStream.
friend class TestFeatureMultipleFileReader [friend] |
Definition at line 90 of file FeatureMultipleFileReader.h.
Definition at line 214 of file FeatureMultipleFileReader.h.
Definition at line 219 of file FeatureMultipleFileReader.h.
Definition at line 221 of file FeatureMultipleFileReader.h.
unsigned long alize::FeatureMultipleFileReader::_fileCount [private] |
Definition at line 215 of file FeatureMultipleFileReader.h.
unsigned long alize::FeatureMultipleFileReader::_fileCounter [private] |
Definition at line 212 of file FeatureMultipleFileReader.h.
const FeatureFileList alize::FeatureMultipleFileReader::_fileList [private] |
Definition at line 213 of file FeatureMultipleFileReader.h.
unsigned long alize::FeatureMultipleFileReader::_lastFeatureIndex [private] |
Definition at line 222 of file FeatureMultipleFileReader.h.
Definition at line 217 of file FeatureMultipleFileReader.h.
unsigned long alize::FeatureMultipleFileReader::_memUsed [private] |
Definition at line 220 of file FeatureMultipleFileReader.h.
Definition at line 218 of file FeatureMultipleFileReader.h.
Definition at line 216 of file FeatureMultipleFileReader.h.
1.7.2