All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
"Implementation classes for Table types"

This group is for classes that implement specific ways of reading and writing Tables; see also "Table types and related functions", "Specific Table types", "Specific Table types", and for a description of the Table concept see The Table concept. More...

Classes

singleton  SequentialTableReaderImplBase< Holder >
 
class  SequentialTableReaderScriptImpl< Holder >
 
class  SequentialTableReaderArchiveImpl< Holder >
 
class  SequentialTableReaderBackgroundImpl< Holder >
 
singleton  TableWriterImplBase< Holder >
 
class  TableWriterArchiveImpl< Holder >
 
class  TableWriterScriptImpl< Holder >
 
class  TableWriterBothImpl< Holder >
 
singleton  RandomAccessTableReaderImplBase< Holder >
 
class  RandomAccessTableReaderScriptImpl< Holder >
 
class  RandomAccessTableReaderArchiveImplBase< Holder >
 
class  RandomAccessTableReaderDSortedArchiveImpl< Holder >
 
class  RandomAccessTableReaderSortedArchiveImpl< Holder >
 
struct  RandomAccessTableReaderSortedArchiveImpl< Holder >::PairCompare
 
class  RandomAccessTableReaderUnsortedArchiveImpl< Holder >
 

Enumerations

enum  StateType {
  kUninitialized, kFileStart, kEof, kError,
  kHaveScpLine, kHaveObject, kHaveRange
}
 
enum  StateType {
  kUninitialized, kFileStart, kEof, kError,
  kHaveObject, kFreedObject
}
 
enum  { kUninitialized, kOpen, kWriteError }
 
enum  { kUninitialized, kReadScript, kNotReadScript }
 
enum  { kUninitialized, kOpen, kWriteError }
 
enum  {
  kUninitialized, kNotReadScript, kNotHaveObject, kHaveObject,
  kHaveRange
}
 
enum  {
  kUninitialized, kNoObject, kHaveObject, kEof,
  kError
}
 

Functions

 SequentialTableReader (const std::string &rspecifier)
 
bool Open (const std::string &rspecifier)
 
bool Close ()
 
bool IsOpen () const
 
std::string Key ()
 
void FreeCurrent ()
 
const T & Value ()
 
void Next ()
 
bool Done ()
 
 ~SequentialTableReader ()
 
 TableWriter (const std::string &wspecifier)
 
bool IsOpen () const
 
bool Open (const std::string &wspecifier)
 
void Write (const std::string &key, const T &value) const
 
void Flush ()
 
bool Close ()
 
 ~TableWriter ()
 
 RandomAccessTableReader (const std::string &rspecifier)
 
bool Open (const std::string &rspecifier)
 
bool HasKey (const std::string &key)
 
const T & Value (const std::string &key)
 
bool Close ()
 
 ~RandomAccessTableReader ()
 
void CheckImpl () const
 
void CheckImpl () const
 
void CheckImpl () const
 
 RandomAccessTableReaderMapped (const std::string &table_rxfilename, const std::string &utt2spk_rxfilename)
 Note: "utt2spk_rxfilename" will in the normal case be an rxfilename for an utterance to speaker map, but this code is general; it accepts a generic map. More...
 
bool Open (const std::string &table_rxfilename, const std::string &utt2spk_rxfilename)
 Note: when calling Open, utt2spk_rxfilename may be empty. More...
 
bool HasKey (const std::string &key)
 
const T & Value (const std::string &key)
 

Detailed Description

This group is for classes that implement specific ways of reading and writing Tables; see also "Table types and related functions", "Specific Table types", "Specific Table types", and for a description of the Table concept see The Table concept.

Enumeration Type Documentation

anonymous enum
private
Enumerator
kUninitialized 
kOpen 
kWriteError 

Definition at line 1134 of file kaldi-table-inl.h.

anonymous enum
private
Enumerator
kUninitialized 
kReadScript 
kNotReadScript 

Definition at line 1294 of file kaldi-table-inl.h.

anonymous enum
private
Enumerator
kUninitialized 
kOpen 
kWriteError 

Definition at line 1474 of file kaldi-table-inl.h.

1474  { // is stream open?
1475  kUninitialized, // no
1476  kOpen, // yes
1477  kWriteError, // yes
1478  } state_;
enum kaldi::TableWriterBothImpl::@3 state_
anonymous enum
private
Enumerator
kUninitialized 
kNotReadScript 
kNotHaveObject 
kHaveObject 
kHaveRange 

Definition at line 1879 of file kaldi-table-inl.h.

1879  {
1880  // (*) is script_ set up?
1881  // (*) does holder_ contain an object?
1882  // (*) does range_holder_ contain and object?
1883  //
1884  //
1885  kUninitialized, // no no no
1886  kNotReadScript, // no no no
1887  kNotHaveObject, // yes no no
1888  kHaveObject, // yes yes no
1889  kHaveRange, // yes yes yes
1890 
1891  // If we are in a state where holder_ contains an object, it always contains
1892  // the object from 'key_', and the corresponding rxfilename is always
1893  // 'data_rxfilename_'. If range_holder_ contains an object, it always
1894  // corresponds to the range 'range_' of the object in 'holder_', and always
1895  // corresponds to the current key.
1896  } state_;
enum kaldi::RandomAccessTableReaderScriptImpl::@4 state_
anonymous enum
protected
Enumerator
kUninitialized 
kNoObject 
kHaveObject 
kEof 
kError 

Definition at line 2047 of file kaldi-table-inl.h.

2047  { // [The state of the reading process] [does holder_ [is input_
2048  // have object] open]
2049  kUninitialized, // Uninitialized or closed no no
2050  kNoObject, // Do not have object in holder_ no yes
2051  kHaveObject, // Have object in holder_ yes yes
2052  kEof, // End of file no yes
2053  kError, // Some kind of error-state in the reading. no yes
2054  } state_;
enum kaldi::RandomAccessTableReaderArchiveImplBase::@5 state_
enum StateType
private
Enumerator
kUninitialized 
kFileStart 
kEof 
kError 
kHaveScpLine 
kHaveObject 
kHaveRange 

Definition at line 449 of file kaldi-table-inl.h.

449  {
450  // Summary of the states this object can be in (state_).
451  //
452  // (*) Does holder_ contain the object corresponding to
453  // data_rxfilename_ ?
454  // (*) Does range_holder_ contain a range object?
455  // (*) is script_input_ open?
456  // (*) are key_, data_rxfilename_ and range_ [if applicable] set?
457  //
458  kUninitialized, // no no no no Uninitialized or closed object.
459  kFileStart, // no no yes no We just opened the .scp file (we'll never be in this
460  // state when a user-visible function is called.)
461  kEof, // no no no no We did Next() and found eof in script file.
462  kError, // no no no no Error reading or parsing script file.
463  kHaveScpLine, // no no yes yes Have a line of the script file but nothing else.
464  kHaveObject, // yes no yes yes holder_ contains an object but range_holder_ does not.
465  kHaveRange, // yes yes yes yes we have the range object in range_holder_ (implies
466  // range_ nonempty).
467  } state_;
enum kaldi::SequentialTableReaderScriptImpl::StateType state_
enum StateType
private
Enumerator
kUninitialized 
kFileStart 
kEof 
kError 
kHaveObject 
kFreedObject 

Definition at line 688 of file kaldi-table-inl.h.

688  { // [The state of the reading process] [does holder_ [is input_
689  // have object] open]
690  kUninitialized, // Uninitialized or closed. no no
691  kFileStart, // [state we use internally: just opened.] no yes
692  kEof, // We did Next() and found eof in archive no no
693  kError, // Some other error no no
694  kHaveObject, // We read the key and the object after it. yes yes
695  kFreedObject, // The user called FreeCurrent(). no yes
696  } state_;
enum kaldi::SequentialTableReaderArchiveImpl::StateType state_

Function Documentation

void CheckImpl ( ) const
private

Definition at line 2612 of file kaldi-table-inl.h.

References KALDI_ERR.

2612  {
2613  if (!impl_) {
2614  KALDI_ERR << "Trying to use empty RandomAccessTableReader (perhaps you "
2615  << "passed the empty string as an argument to a program?)";
2616  }
2617 }
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
void CheckImpl ( ) const
private

Definition at line 2604 of file kaldi-table-inl.h.

References KALDI_ERR.

2604  {
2605  if (!impl_) {
2606  KALDI_ERR << "Trying to use empty SequentialTableReader (perhaps you "
2607  << "passed the empty string as an argument to a program?)";
2608  }
2609 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
#define KALDI_ERR
Definition: kaldi-error.h:127
void CheckImpl ( ) const
private

Definition at line 2620 of file kaldi-table-inl.h.

References KALDI_ERR.

2620  {
2621  if (!impl_) {
2622  KALDI_ERR << "Trying to use empty TableWriter (perhaps you "
2623  << "passed the empty string as an argument to a program?)";
2624  }
2625 }
#define KALDI_ERR
Definition: kaldi-error.h:127
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
bool Close ( )

Definition at line 2589 of file kaldi-table-inl.h.

2589  {
2590  CheckImpl();
2591  bool ans =impl_->Close();
2592  delete impl_;
2593  impl_ = NULL;
2594  return ans;
2595 }
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
void Flush ( )

Definition at line 1537 of file kaldi-table-inl.h.

1537  {
1538  CheckImpl();
1539  impl_->Flush();
1540 }
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
void FreeCurrent ( )

Definition at line 942 of file kaldi-table-inl.h.

Referenced by main(), CRnnLM::setUnkPenalty(), and kaldi::TypeOneUsage().

942  {
943  CheckImpl();
944  impl_->FreeCurrent();
945 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
bool HasKey ( const std::string &  key)

Definition at line 2573 of file kaldi-table-inl.h.

References kaldi::IsToken(), and KALDI_ERR.

Referenced by kaldi::AccCmvnStatsWrapper(), kaldi::AccumulateForUtterance(), ComputeScores(), kaldi::GetEditsDualHyp(), kaldi::GetEditsSingleHyp(), main(), kaldi::ProcessUtterance(), kaldi::ReadData(), kaldi::RunPerSpeaker(), kaldi::UnitTestRangesMatrix(), kaldi::UnitTestTableRandomBothDouble(), and kaldi::UnitTestTableRandomBothDoubleMatrix().

2573  {
2574  CheckImpl();
2575  if (!IsToken(key))
2576  KALDI_ERR << "Invalid key \"" << key << '"';
2577  return impl_->HasKey(key);
2578 }
bool IsToken(const std::string &token)
Returns true if "token" is nonempty, and all characters are printable and whitespace-free.
Definition: text-utils.cc:103
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
bool HasKey ( const std::string &  key)

Definition at line 2655 of file kaldi-table-inl.h.

References KALDI_ERR, and kaldi::PrintableRxfilename().

Referenced by main(), and kaldi::ProcessUtterance().

2655  {
2656  // We don't check IsOpen, we let the call go through to the member variable
2657  // (reader_), which will crash with a more informative error message than
2658  // we can give here, as we don't any longer know the rxfilename.
2659  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2660  if (!token_reader_.HasKey(utt))
2661  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2662  << "in utt2spk map or similar map being read from "
2664  const std::string &spk = token_reader_.Value(utt);
2665  return reader_.HasKey(spk);
2666  } else {
2667  return reader_.HasKey(utt);
2668  }
2669 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:460
std::string PrintableRxfilename(std::string rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
Definition: kaldi-io.cc:58
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:459
bool IsOpen ( ) const

Definition at line 927 of file kaldi-table-inl.h.

927  {
928  return (impl_ != NULL); // Because we delete the object whenever
929  // that object is not open. Thus, the IsOpen functions of the
930  // Impl objects are not really needed.
931 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
bool Open ( const std::string &  rspecifier)

Definition at line 2539 of file kaldi-table-inl.h.

References RspecifierOptions::called_sorted, kaldi::ClassifyRspecifier(), KALDI_ERR, KALDI_WARN, kaldi::kArchiveRspecifier, kaldi::kNoRspecifier, kaldi::kScriptRspecifier, and RspecifierOptions::sorted.

Referenced by main(), and RandomAccessTableReader< Holder >::RandomAccessTableReader().

2539  {
2540  if (IsOpen())
2541  KALDI_ERR << "Already open.";
2542  RspecifierOptions opts;
2543  RspecifierType rs = ClassifyRspecifier(rspecifier, NULL, &opts);
2544  switch (rs) {
2545  case kScriptRspecifier:
2546  impl_ = new RandomAccessTableReaderScriptImpl<Holder>();
2547  break;
2548  case kArchiveRspecifier:
2549  if (opts.sorted) {
2550  if (opts.called_sorted) // "doubly" sorted case.
2551  impl_ = new RandomAccessTableReaderDSortedArchiveImpl<Holder>();
2552  else
2553  impl_ = new RandomAccessTableReaderSortedArchiveImpl<Holder>();
2554  } else {
2555  impl_ = new RandomAccessTableReaderUnsortedArchiveImpl<Holder>();
2556  }
2557  break;
2558  case kNoRspecifier: default:
2559  KALDI_WARN << "Invalid rspecifier: "
2560  << rspecifier;
2561  return false;
2562  }
2563  if (!impl_->Open(rspecifier)) {
2564  // A warning will already have been printed.
2565  delete impl_;
2566  impl_ = NULL;
2567  return false;
2568  }
2569  return true;
2570 }
RspecifierType
Definition: kaldi-table.h:219
#define KALDI_ERR
Definition: kaldi-error.h:127
#define KALDI_WARN
Definition: kaldi-error.h:130
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *wxfilename, RspecifierOptions *opts)
Definition: kaldi-table.cc:225
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
bool Open ( const std::string &  rspecifier)

Definition at line 880 of file kaldi-table-inl.h.

References RspecifierOptions::background, kaldi::ClassifyRspecifier(), KALDI_ERR, KALDI_WARN, kaldi::kArchiveRspecifier, kaldi::kNoRspecifier, and kaldi::kScriptRspecifier.

Referenced by main(), and SequentialTableReader< Holder >::SequentialTableReader().

880  {
881  if (IsOpen())
882  if (!Close())
883  KALDI_ERR << "Could not close previously open object.";
884  // now impl_ will be NULL.
885 
886  RspecifierOptions opts;
887  RspecifierType wt = ClassifyRspecifier(rspecifier, NULL, &opts);
888  switch (wt) {
889  case kArchiveRspecifier:
890  impl_ = new SequentialTableReaderArchiveImpl<Holder>();
891  break;
892  case kScriptRspecifier:
893  impl_ = new SequentialTableReaderScriptImpl<Holder>();
894  break;
895  case kNoRspecifier: default:
896  KALDI_WARN << "Invalid rspecifier " << rspecifier;
897  return false;
898  }
899  if (!impl_->Open(rspecifier)) {
900  delete impl_;
901  impl_ = NULL;
902  return false; // sub-object will have printed warnings.
903  }
904  if (opts.background) {
905  impl_ = new SequentialTableReaderBackgroundImpl<Holder>(
906  impl_);
907  if (!impl_->Open("")) {
908  // the rxfilename is ignored in that Open() call.
909  // It should only return false on code error.
910  return false;
911  }
912  }
913  return true;
914 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
RspecifierType
Definition: kaldi-table.h:219
#define KALDI_ERR
Definition: kaldi-error.h:127
#define KALDI_WARN
Definition: kaldi-error.h:130
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *wxfilename, RspecifierOptions *opts)
Definition: kaldi-table.cc:225
bool Open ( const std::string &  wspecifier)

Definition at line 1496 of file kaldi-table-inl.h.

References kaldi::ClassifyWspecifier(), KALDI_ASSERT, KALDI_ERR, KALDI_WARN, kaldi::kArchiveWspecifier, kaldi::kBothWspecifier, kaldi::kNoWspecifier, and kaldi::kScriptWspecifier.

Referenced by main(), and TableWriter< Holder >::TableWriter().

1496  {
1497  if (IsOpen()) {
1498  if (!Close()) // call Close() yourself to suppress this exception.
1499  KALDI_ERR << "Failed to close previously open writer.";
1500  }
1501  KALDI_ASSERT(impl_ == NULL);
1502  WspecifierType wtype = ClassifyWspecifier(wspecifier, NULL, NULL, NULL);
1503  switch (wtype) {
1504  case kBothWspecifier:
1505  impl_ = new TableWriterBothImpl<Holder>();
1506  break;
1507  case kArchiveWspecifier:
1508  impl_ = new TableWriterArchiveImpl<Holder>();
1509  break;
1510  case kScriptWspecifier:
1511  impl_ = new TableWriterScriptImpl<Holder>();
1512  break;
1513  case kNoWspecifier: default:
1514  KALDI_WARN << "ClassifyWspecifier: invalid wspecifier " << wspecifier;
1515  return false;
1516  }
1517  if (impl_->Open(wspecifier)) {
1518  return true;
1519  } else { // The class will have printed a more specific warning.
1520  delete impl_;
1521  impl_ = NULL;
1522  return false;
1523  }
1524 }
bool IsOpen() const
#define KALDI_ERR
Definition: kaldi-error.h:127
#define KALDI_WARN
Definition: kaldi-error.h:130
WspecifierType
Definition: kaldi-table.h:106
WspecifierType ClassifyWspecifier(const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)
Definition: kaldi-table.cc:135
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:169
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
bool Open ( const std::string &  table_rxfilename,
const std::string &  utt2spk_rxfilename 
)

Note: when calling Open, utt2spk_rxfilename may be empty.

Definition at line 2636 of file kaldi-table-inl.h.

References KALDI_ASSERT.

Referenced by main().

2638  {
2639  if (reader_.IsOpen()) reader_.Close();
2640  if (token_reader_.IsOpen()) token_reader_.Close();
2641  KALDI_ASSERT(!table_rxfilename.empty());
2642  if (!reader_.Open(table_rxfilename)) return false; // will have printed
2643  // warning internally, probably.
2644  if (!utt2spk_rxfilename.empty()) {
2645  if (!token_reader_.Open(utt2spk_rxfilename)) {
2646  reader_.Close();
2647  return false;
2648  }
2649  }
2650  return true;
2651 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:460
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:459
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:169
RandomAccessTableReader ( const std::string &  rspecifier)
explicit

Definition at line 2530 of file kaldi-table-inl.h.

References KALDI_ERR, and RandomAccessTableReader< Holder >::Open().

2531  :
2532  impl_(NULL) {
2533  if (rspecifier != "" && !Open(rspecifier))
2534  KALDI_ERR << "Error opening RandomAccessTableReader object "
2535  " (rspecifier is: " << rspecifier << ")";
2536 }
bool Open(const std::string &rspecifier)
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
RandomAccessTableReaderMapped ( const std::string &  table_rxfilename,
const std::string &  utt2spk_rxfilename 
)

Note: "utt2spk_rxfilename" will in the normal case be an rxfilename for an utterance to speaker map, but this code is general; it accepts a generic map.

Definition at line 2628 of file kaldi-table-inl.h.

2630  :
2631  reader_(table_rxfilename), token_reader_(table_rxfilename.empty() ? "" :
2632  utt2spk_rxfilename),
2633  utt2spk_rxfilename_(utt2spk_rxfilename) { }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:460
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:459
SequentialTableReader ( const std::string &  rspecifier)
explicit

Definition at line 873 of file kaldi-table-inl.h.

References KALDI_ERR, and SequentialTableReader< Holder >::Open().

874  : impl_(NULL) {
875  if (rspecifier != "" && !Open(rspecifier))
876  KALDI_ERR << "Error constructing TableReader: rspecifier is " << rspecifier;
877 }
bool Open(const std::string &rspecifier)
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
#define KALDI_ERR
Definition: kaldi-error.h:127
TableWriter ( const std::string &  wspecifier)
explicit

Definition at line 1483 of file kaldi-table-inl.h.

References KALDI_ERR, and TableWriter< Holder >::Open().

1483  : impl_(NULL) {
1484  if (wspecifier != "" && !Open(wspecifier))
1485  KALDI_ERR << "Failed to open for writing: " << wspecifier
1486  << ": " << strerror(errno);
1487 }
bool Open(const std::string &wspecifier)
#define KALDI_ERR
Definition: kaldi-error.h:127
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
const Holder::T & Value ( const std::string &  key)

Definition at line 2672 of file kaldi-table-inl.h.

References KALDI_ERR, and kaldi::PrintableRxfilename().

Referenced by main(), and kaldi::ProcessUtterance().

2673  {
2674  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2675  if (!token_reader_.HasKey(utt))
2676  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2677  << "in utt2spk map or similar map being read from "
2679  const std::string &spk = token_reader_.Value(utt);
2680  return reader_.Value(spk);
2681  } else {
2682  return reader_.Value(utt);
2683  }
2684 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:460
std::string PrintableRxfilename(std::string rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
Definition: kaldi-io.cc:58
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:459
void Write ( const std::string &  key,
const T value 
) const
inline

Definition at line 1527 of file kaldi-table-inl.h.

References KALDI_ERR.

Referenced by kaldi::AlignUtteranceWrapper(), ComputeLogPosteriors(), CopyExcludedFeats(), CopyIncludedFeats(), kaldi::CopySubsetLattices(), kaldi::DecodeUtterance(), DecodeUtterance(), kaldi::DecodeUtteranceLatticeFaster(), kaldi::DecodeUtteranceLatticeSimple(), main(), kaldi::nnet2::ProcessFile(), kaldi::nnet3::ProcessFile(), kaldi::RunPerSpeaker(), kaldi::TestCompactLatticeTable(), kaldi::TestCompactLatticeTableCross(), kaldi::TestLatticeTable(), kaldi::TestLatticeTableCross(), kaldi::TypeOneUsage(), kaldi::UnitTestRangesMatrix(), kaldi::UnitTestTableRandomBothDouble(), kaldi::UnitTestTableRandomBothDoubleMatrix(), kaldi::UnitTestTableSequentialBaseFloatVectorBoth(), kaldi::UnitTestTableSequentialBool(), kaldi::UnitTestTableSequentialDouble(), kaldi::UnitTestTableSequentialDoubleBoth(), kaldi::UnitTestTableSequentialDoubleMatrixBoth(), kaldi::UnitTestTableSequentialInt32(), kaldi::UnitTestTableSequentialInt32PairVectorBoth(), kaldi::UnitTestTableSequentialInt32Script(), kaldi::UnitTestTableSequentialInt32VectorBoth(), kaldi::UnitTestTableSequentialInt32VectorVectorBoth(), DecodeUtteranceLatticeFasterClass::~DecodeUtteranceLatticeFasterClass(), DeterminizeLatticeTask::~DeterminizeLatticeTask(), IvectorExtractTask::~IvectorExtractTask(), and NnetLogprobTask::~NnetLogprobTask().

1528  {
1529  CheckImpl();
1530  if (!impl_->Write(key, value))
1531  KALDI_ERR << "Error in TableWriter::Write";
1532  // More specific warning will have
1533  // been printed in the Write function.
1534 }
#define KALDI_ERR
Definition: kaldi-error.h:127
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
~RandomAccessTableReader ( )

Definition at line 2598 of file kaldi-table-inl.h.

References KALDI_ERR.

2598  {
2599  if (IsOpen() && !Close()) // call Close() yourself to stop this being thrown.
2600  KALDI_ERR << "failure detected in destructor.";
2601 }
#define KALDI_ERR
Definition: kaldi-error.h:127
~SequentialTableReader ( )

Definition at line 971 of file kaldi-table-inl.h.

971  {
972  delete impl_;
973  // Destructor of impl_ may throw.
974 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
~TableWriter ( )

Definition at line 1553 of file kaldi-table-inl.h.

References KALDI_ERR.

1553  {
1554  if (IsOpen() && !Close()) {
1555  KALDI_ERR << "Error closing TableWriter [in destructor].";
1556  }
1557 }
bool IsOpen() const
#define KALDI_ERR
Definition: kaldi-error.h:127