Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::FeatureMultipleFileReader Class Reference

#include <FeatureMultipleFileReader.h>

Inheritance diagram for alize::FeatureMultipleFileReader:
Inheritance graph
[legend]
Collaboration diagram for alize::FeatureMultipleFileReader:
Collaboration graph
[legend]

List of all members.

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 FeatureFlagsgetFeatureFlags ()
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 StringgetNameOfASource (unsigned long srcIdx)
virtual String getClassName () const
virtual String toString () const

Static Public Member Functions

static FeatureMultipleFileReadercreate (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 ()
FeatureFileReadergetReader (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 FeatureMultipleFileReaderoperator= (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

Detailed Description

Convenient class for reading features from multiples files

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2003

Definition at line 88 of file FeatureMultipleFileReader.h.


Constructor & Destructor Documentation

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.

Parameters:
llist of file to read
lsaddress of a label server. can be NULL.
cconfiguration to use
bebig endian ? Can be BIGENDIAN_AUTO, BIGENDIAN_TRUE or BIGENDIAN_FALSE
virtual alize::FeatureMultipleFileReader::~FeatureMultipleFileReader (  ) [virtual]
alize::FeatureMultipleFileReader::FeatureMultipleFileReader ( const FeatureMultipleFileReader  ) [private]

Not implemented


Member Function Documentation

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.

Parameters:
llist of file to read
lsaddress of a label server. can be NULL.
cconfiguration 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

Returns:
the name of the class of the object as a String

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureMultipleFileReader::getFeatureCount (  ) [virtual]

Returns the number of features in all the files

Returns:
the number of features in all the files
Exceptions:
FileNotFoundExceptionif one of the files does not exist
InvalidDataExceptionif one of the files is not valid
IOExceptionif 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

Parameters:
srcIdxindex of the file
Returns:
the feature count of the file

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureMultipleFileReader::getFeatureCountOfASource ( const FileName f ) [virtual]

Returns the feature count of a feature file

Parameters:
fname of the file
Returns:
the feature count of the file

Implements alize::FeatureInputStream.

virtual const FeatureFlags& alize::FeatureMultipleFileReader::getFeatureFlags (  ) [virtual]

Returns the feature flags of the files

Returns:
the feature flags of the files
Exceptions:
Exceptionthrown if the file list is empty
FileNotFoundExceptionif one of the files does not exist
InvalidDataExceptionif one of the files is not valid
IOExceptionif 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

Parameters:
srcIdxindex of the file
Returns:
the number of the first feature

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureMultipleFileReader::getFirstFeatureIndexOfASource ( const FileName f ) [virtual]

Returns the number of the first feature of a feature file

Parameters:
fname of the file
Returns:
the number of the first feature

Implements alize::FeatureInputStream.

virtual const String& alize::FeatureMultipleFileReader::getNameOfASource ( unsigned long  srcIdx ) [virtual]

Returns the a particular feature file

Parameters:
srcIdxindex of the file
Returns:
the name 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

Returns:
the sample rate of the files
Exceptions:
Exceptionthrown if the file list is empty
FileNotFoundExceptionif one of the files does not exist
InvalidDataExceptionif one of the files is not valid
IOExceptionif something else goes wrong

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureMultipleFileReader::getSourceCount (  ) [virtual]

Returns the number of files read by the reader

Returns:
the number of files

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureMultipleFileReader::getVectSize (  ) [virtual]

Returns the size of the vector inside the features of the files

Returns:
the size of the vector inside the features of the files
Exceptions:
Exceptionthrown if the file list is empty
FileNotFoundExceptionif one of the files does not exist
InvalidDataExceptionif one of the files is not valid
IOExceptionif 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

Parameters:
fthe feature to store the data read
sstep (default value = 1)
Returns:
false if there is no more data because the end of the file has been reached
Exceptions:
IOExceptionif 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

Returns:
a description 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

Parameters:
fthe feature to store the data read
sstep (default value = 1)
Returns:
false if there is no more data because the end of the file has been reached
Exceptions:
IOExceptionif an I/O error occurs

Reimplemented from alize::FeatureInputStream.


Friends And Related Function Documentation

friend class TestFeatureMultipleFileReader [friend]

Definition at line 90 of file FeatureMultipleFileReader.h.


Member Data Documentation

Definition at line 214 of file FeatureMultipleFileReader.h.

Definition at line 219 of file FeatureMultipleFileReader.h.

Definition at line 221 of file FeatureMultipleFileReader.h.

Definition at line 215 of file FeatureMultipleFileReader.h.

Definition at line 212 of file FeatureMultipleFileReader.h.

Definition at line 213 of file FeatureMultipleFileReader.h.

Definition at line 222 of file FeatureMultipleFileReader.h.

Definition at line 217 of file FeatureMultipleFileReader.h.

Definition at line 220 of file FeatureMultipleFileReader.h.

Definition at line 218 of file FeatureMultipleFileReader.h.

Definition at line 216 of file FeatureMultipleFileReader.h.


The documentation for this class was generated from the following file: