WaveInfoHolder Class Reference

#include <wave-reader.h>

Collaboration diagram for WaveInfoHolder:

Public Types

typedef WaveInfo T
 

Public Member Functions

void Clear ()
 
void Swap (WaveInfoHolder *other)
 
TValue ()
 
bool Read (std::istream &is)
 
bool ExtractRange (const WaveInfoHolder &other, const std::string &range)
 

Static Public Member Functions

static bool IsReadInBinary ()
 

Private Attributes

WaveInfo info_
 

Detailed Description

Definition at line 217 of file wave-reader.h.

Member Typedef Documentation

◆ T

typedef WaveInfo T

Definition at line 219 of file wave-reader.h.

Member Function Documentation

◆ Clear()

void Clear ( )
inline

Definition at line 221 of file wave-reader.h.

References WaveInfo::WaveInfo().

221 { info_ = WaveInfo(); }

◆ ExtractRange()

bool ExtractRange ( const WaveInfoHolder other,
const std::string &  range 
)
inline

Definition at line 236 of file wave-reader.h.

References KALDI_ERR.

236  {
237  KALDI_ERR << "ExtractRange is not defined for this type of holder.";
238  return false;
239  }
#define KALDI_ERR
Definition: kaldi-error.h:147

◆ IsReadInBinary()

static bool IsReadInBinary ( )
inlinestatic

Definition at line 224 of file wave-reader.h.

224 { return true; }

◆ Read()

bool Read ( std::istream &  is)
inline

Definition at line 226 of file wave-reader.h.

References KALDI_WARN.

226  {
227  try {
228  info_.Read(is); // Throws exception on failure.
229  return true;
230  } catch (const std::exception &e) {
231  KALDI_WARN << "Exception caught in WaveInfoHolder::Read(). " << e.what();
232  return false;
233  }
234  }
void Read(std::istream &is)
&#39;is&#39; should be opened in binary mode.
Definition: wave-reader.cc:114
#define KALDI_WARN
Definition: kaldi-error.h:150

◆ Swap()

void Swap ( WaveInfoHolder other)
inline

Definition at line 222 of file wave-reader.h.

References WaveInfoHolder::info_, and kaldi::swap().

222 { std::swap(info_, other->info_); }
void swap(basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)

◆ Value()

T& Value ( )
inline

Definition at line 223 of file wave-reader.h.

223 { return info_; }

Member Data Documentation

◆ info_

WaveInfo info_
private

Definition at line 242 of file wave-reader.h.

Referenced by WaveInfoHolder::Swap().


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