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

alize::FeatureInputStreamModifier Class Reference

#include <FeatureInputStreamModifier.h>

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

List of all members.

Public Member Functions

 FeatureInputStreamModifier (FeatureInputStream &is, const String &m="NO_MASK", bool ownStream=false)
void setMask (const String &m)
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 reset ()
virtual void close ()
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 seekFeature (unsigned long featureNbr, const String &srcName)
virtual ~FeatureInputStreamModifier ()
virtual String getClassName () const
virtual String toString () const

Static Public Member Functions

static FeatureInputStreamModifiercreate (FeatureInputStream &is, const String &m="NO_MASK", bool ownStream=false)

Private Member Functions

void updateMask (const String &begin, const String &end)

Private Attributes

FeatureInputStream_pInput
Feature _feature
String _mask
String _tmpMask
ULongVector _selection
unsigned long _selectionSize
bool _useMask
bool _ownStream

Friends

class TestFeatureInputStreamModifier

Detailed Description

<FRANCAIS>Cette classe représente un flux de features sur lequel il est possible d'agir de différentes façons :

TODO : to complete...

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

Definition at line 88 of file FeatureInputStreamModifier.h.


Constructor & Destructor Documentation

alize::FeatureInputStreamModifier::FeatureInputStreamModifier ( FeatureInputStream is,
const String m = "NO_MASK",
bool  ownStream = false 
)

Build the object

Parameters:
mthe mask
isthe input feature stream
virtual alize::FeatureInputStreamModifier::~FeatureInputStreamModifier (  ) [virtual]

Member Function Documentation

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

Closes the input stream

Implements alize::FeatureInputStream.

static FeatureInputStreamModifier& alize::FeatureInputStreamModifier::create ( FeatureInputStream is,
const String m = "NO_MASK",
bool  ownStream = false 
) [static]
virtual String alize::FeatureInputStreamModifier::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::FeatureInputStreamModifier::getFeatureCount (  ) [virtual]

Returns the number of features in the file.

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

Implements alize::FeatureInputStream.

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

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

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

Implements alize::FeatureInputStream.

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

Returns the feature flags of this stream.

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

Implements alize::FeatureInputStream.

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

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

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

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureInputStreamModifier::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 const String& alize::FeatureInputStreamModifier::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.

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

Returns the sample rate of this stream.

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

Implements alize::FeatureInputStream.

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

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

Returns:
the number of sources

Implements alize::FeatureInputStream.

virtual unsigned long alize::FeatureInputStreamModifier::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

Implements alize::FeatureInputStream.

virtual bool alize::FeatureInputStreamModifier::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::FeatureInputStreamModifier::reset (  ) [virtual]

Resets the input stream

Implements alize::FeatureInputStream.

virtual void alize::FeatureInputStreamModifier::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

Implements alize::FeatureInputStream.

void alize::FeatureInputStreamModifier::setMask ( const String m )

Defines the mask to select acoustic parameters
Examples :
"0" : select parameter #0
"1-35" : select parameters #1 to #35
"0,1-3,6,7" : select parameters #0 and #1 to #3 and #6 and #7
Characters allowed : "0" to "9", "," and "-".
To remove the mask, set m to "NO_MASK"

Exceptions:
Exceptionif the mask is invalid
virtual String alize::FeatureInputStreamModifier::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.

void alize::FeatureInputStreamModifier::updateMask ( const String begin,
const String end 
) [private]
virtual bool alize::FeatureInputStreamModifier::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 TestFeatureInputStreamModifier [friend]

Definition at line 91 of file FeatureInputStreamModifier.h.


Member Data Documentation

Definition at line 200 of file FeatureInputStreamModifier.h.

Definition at line 201 of file FeatureInputStreamModifier.h.

Definition at line 206 of file FeatureInputStreamModifier.h.

Definition at line 199 of file FeatureInputStreamModifier.h.

Definition at line 203 of file FeatureInputStreamModifier.h.

Definition at line 204 of file FeatureInputStreamModifier.h.

Definition at line 202 of file FeatureInputStreamModifier.h.

Definition at line 205 of file FeatureInputStreamModifier.h.


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