Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends

alize::FeatureFileReaderSingle Class Reference

#include <FeatureFileReaderSingle.h>

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

List of all members.

Public Member Functions

 FeatureFileReaderSingle (FileReader *, FeatureInputStream *, const Config &, LabelServer *, BufferUsage, unsigned long bufferSize, HistoricUsage, unsigned long historicSize)
virtual ~FeatureFileReaderSingle ()
virtual void close ()
virtual bool readFeature (Feature &, unsigned long step=1)
virtual bool writeFeature (const Feature &f, unsigned long step=1)
virtual unsigned long getSourceCount ()
virtual unsigned long getFeatureCountOfASource (unsigned long srcIdx)
virtual unsigned long getFeatureCountOfASource (const String &srcName)
virtual unsigned long getFirstFeatureIndexOfASource (unsigned long srcIdx)
virtual unsigned long getFirstFeatureIndexOfASource (const String &srcName)
virtual const StringgetNameOfASource (unsigned long srcIdx)
virtual void setExternalBufferToUse (FloatVector &v)
virtual String toString () const

Protected Member Functions

String getPath (const FileName &, const Config &) const
String getExt (const FileName &, const Config &) const
bool getBigEndian (const Config &, BigEndian) const

Protected Attributes

FileReader_pReader
FeatureInputStream_pFeatureInputStream
Feature_pFeature
unsigned long _headerLength
unsigned long _featureCount
unsigned long _vectSize
FeatureFlags _flags
real_t _sampleRate
unsigned long _featureIndex
unsigned long _lastFeatureIndex
unsigned long _featureIndexOfBuffer
unsigned long _nbStored
FloatVector_pBuffer
Feature _f

Private Member Functions

virtual unsigned long getHeaderLength ()
bool featureWantedIsInHistoric () const

Friends

class TestFeatureFileReader

Detailed Description

Abstract base class for feature file readers

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

Definition at line 82 of file FeatureFileReaderSingle.h.


Constructor & Destructor Documentation

alize::FeatureFileReaderSingle::FeatureFileReaderSingle ( FileReader ,
FeatureInputStream ,
const Config ,
LabelServer ,
BufferUsage  ,
unsigned long  bufferSize,
HistoricUsage  ,
unsigned long  historicSize 
)
virtual alize::FeatureFileReaderSingle::~FeatureFileReaderSingle (  ) [virtual]

Member Function Documentation

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

Closes the opened file

Implements alize::FeatureInputStream.

bool alize::FeatureFileReaderSingle::featureWantedIsInHistoric (  ) const [private]
bool alize::FeatureFileReaderSingle::getBigEndian ( const Config ,
BigEndian   
) const [protected]
String alize::FeatureFileReaderSingle::getExt ( const FileName ,
const Config  
) const [protected]
virtual unsigned long alize::FeatureFileReaderSingle::getFeatureCountOfASource ( unsigned long  srcIdx ) [virtual]

Returns the feature count of a feature source (a file)

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

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureFileReaderSingle::getFeatureCountOfASource ( const String srcName ) [virtual]

Returns the feature count of a feature source (a file)

Parameters:
srcNamename of the source
Returns:
the feature count of the source

Implements alize::FeatureInputStream.

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

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

Parameters:
srcNamename of the source
Returns:
the number of the first feature

Implements alize::FeatureInputStream.

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

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

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

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureFileReaderSingle::getHeaderLength (  ) [private, virtual]
virtual const String& alize::FeatureFileReaderSingle::getNameOfASource ( unsigned long  srcIdx ) [virtual]

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

Parameters:
srcIdxindex of the source
Returns:
the name of the source

Implements alize::FeatureInputStream.

String alize::FeatureFileReaderSingle::getPath ( const FileName ,
const Config  
) const [protected]
virtual unsigned long alize::FeatureFileReaderSingle::getSourceCount (  ) [virtual]

Returns the number of sources (files) read by the reader

Returns:
the number of sources

Implements alize::FeatureInputStream.

virtual bool alize::FeatureFileReaderSingle::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::FeatureFileReaderSingle::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 String alize::FeatureFileReaderSingle::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::FeatureFileReaderSingle::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 84 of file FeatureFileReaderSingle.h.


Member Data Documentation

Definition at line 126 of file FeatureFileReaderSingle.h.

Definition at line 116 of file FeatureFileReaderSingle.h.

Definition at line 120 of file FeatureFileReaderSingle.h.

Definition at line 123 of file FeatureFileReaderSingle.h.

Definition at line 118 of file FeatureFileReaderSingle.h.

Definition at line 115 of file FeatureFileReaderSingle.h.

Definition at line 121 of file FeatureFileReaderSingle.h.

unsigned long alize::FeatureFileReaderSingle::_nbStored [protected]

Definition at line 124 of file FeatureFileReaderSingle.h.

Definition at line 125 of file FeatureFileReaderSingle.h.

Definition at line 114 of file FeatureFileReaderSingle.h.

Definition at line 113 of file FeatureFileReaderSingle.h.

Definition at line 112 of file FeatureFileReaderSingle.h.

Definition at line 119 of file FeatureFileReaderSingle.h.

unsigned long alize::FeatureFileReaderSingle::_vectSize [protected]

Definition at line 117 of file FeatureFileReaderSingle.h.


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