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

alize::FeatureFileReader Class Reference

#include <FeatureFileReader.h>

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

List of all members.

Public Member Functions

 FeatureFileReader (const Config &c)
 FeatureFileReader (const FileName &f, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0)
 FeatureFileReader (const XLine &l, const Config &, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0)
virtual ~FeatureFileReader ()
virtual void seekFeature (unsigned long featureNbr, const String &srcName="")
virtual bool readFeature (Feature &f, unsigned long s=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 unsigned long getSourceCount ()
virtual unsigned long getFeatureCountOfASource (unsigned long srcIdx)
virtual unsigned long getFeatureCountOfASource (const String &src)
virtual unsigned long getFirstFeatureIndexOfASource (unsigned long srcIdx)
virtual unsigned long getFirstFeatureIndexOfASource (const String &srcName)
virtual const StringgetNameOfASource (unsigned long srcIdx)
virtual void close ()
virtual void setExternalBufferToUse (FloatVector &v)
virtual String getClassName () const

Static Public Member Functions

static FeatureFileReadercreate (const Config &c)
static FeatureFileReadercreate (const FileName &f, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0)
static FeatureFileReadercreate (const XLine &l, const Config &c, LabelServer *ls=NULL, BigEndian be=BIGENDIAN_AUTO, BufferUsage=BUFFER_AUTO, unsigned long bufferSize=0, HistoricUsage=ALL_FEATURES, unsigned long historicSize=0)
static FeatureFileReaderAbstractcreateStream (const Config &c)
static FeatureFileReaderAbstractcreateStream (const FileName &f, const Config &c, LabelServer *ls, BigEndian be, BufferUsage b, unsigned long bufferSize, HistoricUsage, unsigned long historicSize)
static FeatureFileReaderAbstractcreateStream (const XLine &l, const Config &c, LabelServer *p, BigEndian be, BufferUsage b, unsigned long bufferSize, HistoricUsage, unsigned long historicSize)

Private Member Functions

bool operator== (const FeatureFileReader &) const
bool operator!= (const FeatureFileReader &) const
const FeatureFileReaderoperator= (const FeatureFileReader &)
 FeatureFileReader (const FeatureFileReader &)

Private Attributes

FeatureFileReaderAbstract_pFeatureReader

Friends

class TestFeatureFileReader

Detailed Description

Convenient class for reading features from files with various formats (HTK, SPRO3/4, RAW)

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

Definition at line 84 of file FeatureFileReader.h.


Constructor & Destructor Documentation

alize::FeatureFileReader::FeatureFileReader ( const Config c )

Creates a reader for an empty file.

Parameters:
cthe configuration to use
alize::FeatureFileReader::FeatureFileReader ( const FileName f,
const Config c,
LabelServer ls = NULL,
BigEndian  be = BIGENDIAN_AUTO,
BufferUsage  = BUFFER_AUTO,
unsigned long  bufferSize = 0,
HistoricUsage  = ALL_FEATURES,
unsigned long  historicSize = 0 
)

Creates a reader for a feature file.

Parameters:
fa file to read. No path is required. It uses the parameter "featureFilesPath" of the configuration.
cthe configuration to use
lsaddress of a label server. can be NULL.
bebig endian ? Can be BIGENDIAN_AUTO, BIGENDIAN_TRUE or BIGENDIAN_FALSE
alize::FeatureFileReader::FeatureFileReader ( const XLine l,
const Config ,
LabelServer ls = NULL,
BigEndian  be = BIGENDIAN_AUTO,
BufferUsage  = 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::FeatureFileReader::~FeatureFileReader (  ) [virtual]
alize::FeatureFileReader::FeatureFileReader ( const FeatureFileReader  ) [private]

Not implemented


Member Function Documentation

virtual void alize::FeatureFileReader::close (  ) [virtual]

Closes all opened files

Implements alize::FeatureInputStream.

static FeatureFileReader& alize::FeatureFileReader::create ( const Config c ) [static]

See constructor with same parameters

static FeatureFileReader& alize::FeatureFileReader::create ( const FileName f,
const Config c,
LabelServer ls = NULL,
BigEndian  be = BIGENDIAN_AUTO,
BufferUsage  = BUFFER_AUTO,
unsigned long  bufferSize = 0,
HistoricUsage  = ALL_FEATURES,
unsigned long  historicSize = 0 
) [static]

See constructor with same parameters

static FeatureFileReader& alize::FeatureFileReader::create ( const XLine l,
const Config c,
LabelServer ls = NULL,
BigEndian  be = BIGENDIAN_AUTO,
BufferUsage  = BUFFER_AUTO,
unsigned long  bufferSize = 0,
HistoricUsage  = ALL_FEATURES,
unsigned long  historicSize = 0 
) [static]

See constructor with same parameters

static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream ( const Config c ) [static]
static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream ( const FileName f,
const Config c,
LabelServer ls,
BigEndian  be,
BufferUsage  b,
unsigned long  bufferSize,
HistoricUsage  ,
unsigned long  historicSize 
) [static]
static FeatureFileReaderAbstract& alize::FeatureFileReader::createStream ( const XLine l,
const Config c,
LabelServer p,
BigEndian  be,
BufferUsage  b,
unsigned long  bufferSize,
HistoricUsage  ,
unsigned long  historicSize 
) [static]
virtual String alize::FeatureFileReader::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::FeatureFileReader::getFeatureCount (  ) [virtual]

Returns the number of features in the file

Returns:
the number of features in the file
Exceptions:
Exceptionif vectSize is 0
IOExceptionif an I/O error occurs

Implements alize::FeatureInputStream.

Referenced by alize::FeatureFileList::getFeatureCount().

virtual unsigned long alize::FeatureFileReader::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::FeatureFileReader::getFeatureCountOfASource ( const String src ) [virtual]

Returns the feature count of a feature file

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

Implements alize::FeatureInputStream.

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

Returns the feature flags of this stream.

Returns:
the feature flags of this stream
Exceptions:
IOExceptionif an I/O error occurs
FileNotFoundException

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureFileReader::getFirstFeatureIndexOfASource ( unsigned long  srcIdx ) [virtual]

Returns the number of the first feature of a feature file. Useful for a multiple file stream.

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

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureFileReader::getFirstFeatureIndexOfASource ( const String srcName ) [virtual]

Returns the number of the first feature of a feature file. Useful for a multiple file stream.

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

Implements alize::FeatureInputStream.

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

Returns the a particular feature file. Useful for a multiple file stream.

Parameters:
srcIdxindex of the file
Returns:
the name of the file

Implements alize::FeatureInputStream.

virtual real_t alize::FeatureFileReader::getSampleRate (  ) [virtual]

Returns the sample rate of this stream.

Returns:
the sample rate of this stream
Exceptions:
IOExceptionif an I/O error occurs
FileNotFoundException

Implements alize::FeatureInputStream.

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

Returns the number of files read by the reader

Returns:
the number of files

Implements alize::FeatureInputStream.

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

Returns the size of the vector inside each feature of the stream.

Returns:
the size of the vector inside each feature of the stream
Exceptions:
IOExceptionif an I/O error occurs
FileNotFoundException

Implements alize::FeatureInputStream.

bool alize::FeatureFileReader::operator!= ( const FeatureFileReader  ) const [private]

Not implemented

const FeatureFileReader& alize::FeatureFileReader::operator= ( const FeatureFileReader  ) [private]

Not implemented

bool alize::FeatureFileReader::operator== ( const FeatureFileReader  ) const [private]
virtual bool alize::FeatureFileReader::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.

virtual void alize::FeatureFileReader::seekFeature ( unsigned long  pos,
const String srcName = "" 
) [virtual]

Sets the position indicator associated with the stream to a new position. Does not throw any exception or error.

Parameters:
posnew position of the indicator
srcNamesource name to seek in a particular source

Reimplemented from alize::FeatureFileReaderAbstract.

virtual void alize::FeatureFileReader::setExternalBufferToUse ( FloatVector v ) [virtual]

Connects an external buffer to the reader. This buffer will replace the internal buffer.

Parameters:
vthe vector

Reimplemented from alize::FeatureFileReaderAbstract.

virtual bool alize::FeatureFileReader::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 TestFeatureFileReader [friend]

Definition at line 88 of file FeatureFileReader.h.


Member Data Documentation

Definition at line 243 of file FeatureFileReader.h.


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