#include <FeatureInputStream.h>


Public Types | |
| enum | Error { NO_ERROR, FEATURE_OUT_OF_HISTORY } |
Public Member Functions | |
| FeatureInputStream () | |
| FeatureInputStream (const Config &c, LabelServer *ls=NULL) | |
| const Config & | getConfig () const |
| bool | existsConfig () const |
| virtual | ~FeatureInputStream () |
| virtual bool | readFeature (Feature &f, unsigned long s=1)=0 |
| virtual bool | writeFeature (const Feature &f, unsigned long s=1) |
| virtual void | reset ()=0 |
| virtual void | close ()=0 |
| virtual unsigned long | getVectSize ()=0 |
| virtual const FeatureFlags & | getFeatureFlags ()=0 |
| virtual real_t | getSampleRate ()=0 |
| virtual unsigned long | getFeatureCount ()=0 |
| virtual void | seekFeature (unsigned long pos, const String &srcName="")=0 |
| virtual unsigned long | getSourceCount ()=0 |
| virtual unsigned long | getFeatureCountOfASource (unsigned long srcIdx)=0 |
| virtual unsigned long | getFeatureCountOfASource (const String &srcName)=0 |
| virtual unsigned long | getFirstFeatureIndexOfASource (unsigned long srcIdx)=0 |
| virtual unsigned long | getFirstFeatureIndexOfASource (const String &srcName)=0 |
| virtual const String & | getNameOfASource (unsigned long srcIdx)=0 |
| Error | getError () |
| virtual String | getClassName () const =0 |
Protected Member Functions | |
| void | init (const Config &c, LabelServer *ls=NULL) |
Protected Attributes | |
| LabelServer * | _pLabelServer |
| Error | _error |
| bool | _seekWanted |
| unsigned long | _seekWantedIdx |
| String | _seekWantedSrcName |
| bool | _featuresAreWritable |
Private Attributes | |
| const Config * | _pConfig |
Abstract class for a feature input stream. <FRANCAIS>
Classe abstraite de base pour les classes dont le rôle est de fournir des features a la demande (methode readFeature). Toutes ces classes peuvent etre connectees a un serveur de label. Ainsi il leur est possible d'affecter un label ŕ chaque feature. L'adresse du serveur de label peut etre passee lors de la contruction La variable _error permet aux sous-classes de passer un message a l'utilisateur. Par exemple : signaler la cause d'un arret d'envoi de donnees (fin de fichier, fin de stream...)
Ce message peut etre lu grace a la methode heritee publique getError()
Definition at line 95 of file FeatureInputStream.h.
Definition at line 100 of file FeatureInputStream.h.
| alize::FeatureInputStream::FeatureInputStream | ( | ) | [explicit] |
| alize::FeatureInputStream::FeatureInputStream | ( | const Config & | c, |
| LabelServer * | ls = NULL |
||
| ) | [explicit] |
Store the address of the label server and set the internal message to "".
| p | Address of the label server. Can be NULL. |
| virtual alize::FeatureInputStream::~FeatureInputStream | ( | ) | [virtual] |
| virtual void alize::FeatureInputStream::close | ( | ) | [pure virtual] |
| bool alize::FeatureInputStream::existsConfig | ( | ) | const |
| virtual String alize::FeatureInputStream::getClassName | ( | ) | const [pure virtual] |
Returns the name of the class
Implements alize::Object.
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderHTK, alize::FeatureFileReaderRaw, alize::FeatureFileReaderSPro3, alize::FeatureFileReaderSPro4, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| const Config& alize::FeatureInputStream::getConfig | ( | ) | const |
| S::Error FeatureInputStream::getError | ( | ) |
Gets the last feature error code from this stream
Definition at line 95 of file FeatureInputStream.cpp.
References _error.
| virtual unsigned long alize::FeatureInputStream::getFeatureCount | ( | ) | [pure virtual] |
Returns the number of features of the stream. Must be overloaded in derived classes. Always throw Exception in this class.
| IOException | if an I/O error occurs |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderHTK, alize::FeatureFileReaderRaw, alize::FeatureFileReaderSPro3, alize::FeatureFileReaderSPro4, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getFeatureCountOfASource | ( | unsigned long | srcIdx ) | [pure virtual] |
Returns the feature count of a feature source (a file)
| srcIdx | index of the source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getFeatureCountOfASource | ( | const String & | srcName ) | [pure virtual] |
Returns the feature count of a feature source (a file)
| srcName | name of the source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual const FeatureFlags& alize::FeatureInputStream::getFeatureFlags | ( | ) | [pure virtual] |
Returns the feature flags of this stream. Must be overloaded in derived classes.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderHTK, alize::FeatureFileReaderRaw, alize::FeatureFileReaderSPro3, alize::FeatureFileReaderSPro4, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getFirstFeatureIndexOfASource | ( | const String & | srcName ) | [pure virtual] |
Returns the number of the first feature of a feature source. Useful for a multiple source stream.
| srcName | name of the source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getFirstFeatureIndexOfASource | ( | unsigned long | srcIdx ) | [pure virtual] |
Returns the number of the first feature of a feature source. Useful for a multiple source stream.
| srcIdx | index of the source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual const String& alize::FeatureInputStream::getNameOfASource | ( | unsigned long | srcIdx ) | [pure virtual] |
Returns the a particular feature source. Useful for a multiple source stream.
| srcIdx | index of the source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual real_t alize::FeatureInputStream::getSampleRate | ( | ) | [pure virtual] |
Returns the sample rate of this stream. Must be overloaded in derived classes.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderHTK, alize::FeatureFileReaderRaw, alize::FeatureFileReaderSPro3, alize::FeatureFileReaderSPro4, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getSourceCount | ( | ) | [pure virtual] |
Returns the number of sources (files) read by the reader
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual unsigned long alize::FeatureInputStream::getVectSize | ( | ) | [pure virtual] |
Returns the size of the vector inside each feature of the stream. Must be overloaded in derived classes.
| IOException | if an I/O error occurs |
| FileNotFoundException |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderHTK, alize::FeatureFileReaderRaw, alize::FeatureFileReaderSPro3, alize::FeatureFileReaderSPro4, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| void alize::FeatureInputStream::init | ( | const Config & | c, |
| LabelServer * | ls = NULL |
||
| ) | [protected] |
| virtual bool alize::FeatureInputStream::readFeature | ( | Feature & | f, |
| unsigned long | s = 1 |
||
| ) | [pure 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 |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
| virtual void alize::FeatureInputStream::reset | ( | ) | [pure virtual] |
Implemented in alize::FeatureFileReaderAbstract, alize::FeatureInputStreamModifier, and alize::FeatureServer.
| virtual void alize::FeatureInputStream::seekFeature | ( | unsigned long | pos, |
| const String & | srcName = "" |
||
| ) | [pure virtual] |
Sets the position indicator associated with the stream to a new position. Does not throw any exception or error.
| pos | new position of the indicator |
| srcName | source name to seek in a particular source |
Implemented in alize::FeatureFileReader, alize::FeatureFileReaderAbstract, alize::FeatureInputStreamModifier, and alize::FeatureServer.
| bool FeatureInputStream::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 in alize::FeatureFileReader, alize::FeatureFileReaderSingle, alize::FeatureInputStreamModifier, alize::FeatureMultipleFileReader, and alize::FeatureServer.
Definition at line 97 of file FeatureInputStream.cpp.
Error alize::FeatureInputStream::_error [protected] |
Definition at line 228 of file FeatureInputStream.h.
Referenced by getError().
bool alize::FeatureInputStream::_featuresAreWritable [protected] |
Definition at line 232 of file FeatureInputStream.h.
const Config* alize::FeatureInputStream::_pConfig [private] |
Definition at line 236 of file FeatureInputStream.h.
LabelServer* alize::FeatureInputStream::_pLabelServer [protected] |
Definition at line 227 of file FeatureInputStream.h.
bool alize::FeatureInputStream::_seekWanted [protected] |
Definition at line 229 of file FeatureInputStream.h.
unsigned long alize::FeatureInputStream::_seekWantedIdx [protected] |
Definition at line 230 of file FeatureInputStream.h.
String alize::FeatureInputStream::_seekWantedSrcName [protected] |
Definition at line 231 of file FeatureInputStream.h.
1.7.2