"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

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

Functions

 SequentialTableReader (const std::string &rspecifier)
 
bool Open (const std::string &rspecifier)
 
bool Close ()
 
bool IsOpen () const
 
std::string Key ()
 
void FreeCurrent ()
 
TValue ()
 
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 TValue (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 TValue (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.

Function Documentation

◆ CheckImpl() [1/3]

void CheckImpl ( ) const
private

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

2590  {
2591  if (!impl_) {
2592  KALDI_ERR << "Trying to use empty RandomAccessTableReader (perhaps you "
2593  << "passed the empty string as an argument to a program?)";
2594  }
2595 }
#define KALDI_ERR
Definition: kaldi-error.h:147
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279

◆ CheckImpl() [2/3]

void CheckImpl ( ) const
private

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

References KALDI_ERR.

Referenced by SequentialTableReader< Holder >::Close(), SequentialTableReader< Holder >::Done(), SequentialTableReader< Holder >::FreeCurrent(), SequentialTableReader< Holder >::Key(), SequentialTableReader< Holder >::Next(), and SequentialTableReader< Holder >::Value().

2582  {
2583  if (!impl_) {
2584  KALDI_ERR << "Trying to use empty SequentialTableReader (perhaps you "
2585  << "passed the empty string as an argument to a program?)";
2586  }
2587 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361
#define KALDI_ERR
Definition: kaldi-error.h:147

◆ CheckImpl() [3/3]

void CheckImpl ( ) const
private

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

References KALDI_ERR.

Referenced by TableWriter< Holder >::Close(), TableWriter< Holder >::Flush(), and TableWriter< Holder >::Write().

2598  {
2599  if (!impl_) {
2600  KALDI_ERR << "Trying to use empty TableWriter (perhaps you "
2601  << "passed the empty string as an argument to a program?)";
2602  }
2603 }
#define KALDI_ERR
Definition: kaldi-error.h:147
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ Close() [1/3]

bool Close ( )

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

2567  {
2568  CheckImpl();
2569  bool ans =impl_->Close();
2570  delete impl_;
2571  impl_ = NULL;
2572  return ans;
2573 }
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279

◆ Close() [2/3]

◆ Close() [3/3]

bool Close ( )

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

References TableWriter< Holder >::CheckImpl(), and TableWriter< Holder >::impl_.

Referenced by TableWriter< Holder >::Open(), RandomAccessTableReaderArchiveImplBase< Holder >::Open(), kaldi::TestCompactLatticeTable(), kaldi::TestCompactLatticeTableCross(), kaldi::TestLatticeTable(), kaldi::TestLatticeTableCross(), kaldi::UnitTestTableRandomBothDouble(), kaldi::UnitTestTableRandomBothDoubleMatrix(), kaldi::UnitTestTableSequentialBaseFloatVectorBoth(), kaldi::UnitTestTableSequentialBool(), kaldi::UnitTestTableSequentialDouble(), kaldi::UnitTestTableSequentialDoubleBoth(), kaldi::UnitTestTableSequentialDoubleMatrixBoth(), kaldi::UnitTestTableSequentialInt32(), kaldi::UnitTestTableSequentialInt32PairVectorBoth(), kaldi::UnitTestTableSequentialInt32Script(), kaldi::UnitTestTableSequentialInt32VectorBoth(), kaldi::UnitTestTableSequentialInt32VectorVectorBoth(), RandomAccessTableReaderDSortedArchiveImpl< Holder >::~RandomAccessTableReaderDSortedArchiveImpl(), RandomAccessTableReaderSortedArchiveImpl< Holder >::~RandomAccessTableReaderSortedArchiveImpl(), RandomAccessTableReaderUnsortedArchiveImpl< Holder >::~RandomAccessTableReaderUnsortedArchiveImpl(), and TableWriter< Holder >::~TableWriter().

1527  {
1528  CheckImpl();
1529  bool ans = impl_->Close();
1530  delete impl_; // We don't keep around non-open impl_ objects
1531  // [c.f. definition of IsOpen()]
1532  impl_ = NULL;
1533  return ans;
1534 }
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ Done()

◆ Flush()

void Flush ( )

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

References TableWriter< Holder >::CheckImpl(), and TableWriter< Holder >::impl_.

1521  {
1522  CheckImpl();
1523  impl_->Flush();
1524 }
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ FreeCurrent()

void FreeCurrent ( )

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

References SequentialTableReader< Holder >::CheckImpl(), and SequentialTableReader< Holder >::impl_.

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

926  {
927  CheckImpl();
928  impl_->FreeCurrent();
929 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361

◆ HasKey() [1/2]

bool HasKey ( const std::string &  key)

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

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().

2551  {
2552  CheckImpl();
2553  if (!IsToken(key))
2554  KALDI_ERR << "Invalid key \"" << key << '"';
2555  return impl_->HasKey(key);
2556 }
bool IsToken(const std::string &token)
Returns true if "token" is nonempty, and all characters are printable and whitespace-free.
Definition: text-utils.cc:105
#define KALDI_ERR
Definition: kaldi-error.h:147
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279

◆ HasKey() [2/2]

bool HasKey ( const std::string &  key)

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

References KALDI_ERR, kaldi::PrintableRxfilename(), RandomAccessTableReaderMapped< Holder >::reader_, RandomAccessTableReaderMapped< Holder >::token_reader_, and RandomAccessTableReaderMapped< Holder >::utt2spk_rxfilename_.

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

2633  {
2634  // We don't check IsOpen, we let the call go through to the member variable
2635  // (reader_), which will crash with a more informative error message than
2636  // we can give here, as we don't any longer know the rxfilename.
2637  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2638  if (!token_reader_.HasKey(utt))
2639  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2640  << "in utt2spk map or similar map being read from "
2642  const std::string &spk = token_reader_.Value(utt);
2643  return reader_.HasKey(spk);
2644  } else {
2645  return reader_.HasKey(utt);
2646  }
2647 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:461
#define KALDI_ERR
Definition: kaldi-error.h:147
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460
std::string PrintableRxfilename(const std::string &rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
Definition: kaldi-io.cc:61

◆ IsOpen() [1/2]

bool IsOpen ( ) const

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

References SequentialTableReader< Holder >::impl_.

Referenced by TableWriterArchiveImpl< Holder >::Close(), TableWriterScriptImpl< Holder >::Close(), TableWriterBothImpl< Holder >::Close(), SequentialTableReader< Holder >::Open(), TableWriterScriptImpl< Holder >::Write(), TableWriterArchiveImpl< Holder >::~TableWriterArchiveImpl(), and TableWriterBothImpl< Holder >::~TableWriterBothImpl().

911  {
912  return (impl_ != NULL); // Because we delete the object whenever
913  // that object is not open. Thus, the IsOpen functions of the
914  // Impl objects are not really needed.
915 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361

◆ IsOpen() [2/2]

◆ Key()

◆ Next()

◆ Open() [1/4]

bool Open ( const std::string &  rspecifier)

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

Referenced by main().

2517  {
2518  if (IsOpen())
2519  KALDI_ERR << "Already open.";
2520  RspecifierOptions opts;
2521  RspecifierType rs = ClassifyRspecifier(rspecifier, NULL, &opts);
2522  switch (rs) {
2523  case kScriptRspecifier:
2524  impl_ = new RandomAccessTableReaderScriptImpl<Holder>();
2525  break;
2526  case kArchiveRspecifier:
2527  if (opts.sorted) {
2528  if (opts.called_sorted) // "doubly" sorted case.
2529  impl_ = new RandomAccessTableReaderDSortedArchiveImpl<Holder>();
2530  else
2531  impl_ = new RandomAccessTableReaderSortedArchiveImpl<Holder>();
2532  } else {
2533  impl_ = new RandomAccessTableReaderUnsortedArchiveImpl<Holder>();
2534  }
2535  break;
2536  case kNoRspecifier: default:
2537  KALDI_WARN << "Invalid rspecifier: "
2538  << rspecifier;
2539  return false;
2540  }
2541  if (!impl_->Open(rspecifier)) {
2542  // A warning will already have been printed.
2543  delete impl_;
2544  impl_ = NULL;
2545  return false;
2546  }
2547  return true;
2548 }
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
Definition: kaldi-table.cc:225
RspecifierType
Definition: kaldi-table.h:219
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_WARN
Definition: kaldi-error.h:150
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279

◆ Open() [2/4]

bool Open ( const std::string &  rspecifier)

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

References RspecifierOptions::background, kaldi::ClassifyRspecifier(), SequentialTableReader< Holder >::Close(), SequentialTableReader< Holder >::impl_, SequentialTableReader< Holder >::IsOpen(), KALDI_ERR, KALDI_WARN, kaldi::kArchiveRspecifier, kaldi::kNoRspecifier, and kaldi::kScriptRspecifier.

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

864  {
865  if (IsOpen())
866  if (!Close())
867  KALDI_ERR << "Could not close previously open object.";
868  // now impl_ will be NULL.
869 
870  RspecifierOptions opts;
871  RspecifierType wt = ClassifyRspecifier(rspecifier, NULL, &opts);
872  switch (wt) {
873  case kArchiveRspecifier:
874  impl_ = new SequentialTableReaderArchiveImpl<Holder>();
875  break;
876  case kScriptRspecifier:
877  impl_ = new SequentialTableReaderScriptImpl<Holder>();
878  break;
879  case kNoRspecifier: default:
880  KALDI_WARN << "Invalid rspecifier " << rspecifier;
881  return false;
882  }
883  if (!impl_->Open(rspecifier)) {
884  delete impl_;
885  impl_ = NULL;
886  return false; // sub-object will have printed warnings.
887  }
888  if (opts.background) {
889  impl_ = new SequentialTableReaderBackgroundImpl<Holder>(
890  impl_);
891  if (!impl_->Open("")) {
892  // the rxfilename is ignored in that Open() call.
893  // It should only return false on code error.
894  return false;
895  }
896  }
897  return true;
898 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
Definition: kaldi-table.cc:225
RspecifierType
Definition: kaldi-table.h:219
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_WARN
Definition: kaldi-error.h:150

◆ Open() [3/4]

bool Open ( const std::string &  wspecifier)

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

References kaldi::ClassifyWspecifier(), TableWriter< Holder >::Close(), TableWriter< Holder >::impl_, TableWriter< Holder >::IsOpen(), KALDI_ASSERT, KALDI_ERR, KALDI_WARN, kaldi::kArchiveWspecifier, kaldi::kBothWspecifier, kaldi::kNoWspecifier, and kaldi::kScriptWspecifier.

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

1480  {
1481  if (IsOpen()) {
1482  if (!Close()) // call Close() yourself to suppress this exception.
1483  KALDI_ERR << "Failed to close previously open writer.";
1484  }
1485  KALDI_ASSERT(impl_ == NULL);
1486  WspecifierType wtype = ClassifyWspecifier(wspecifier, NULL, NULL, NULL);
1487  switch (wtype) {
1488  case kBothWspecifier:
1489  impl_ = new TableWriterBothImpl<Holder>();
1490  break;
1491  case kArchiveWspecifier:
1492  impl_ = new TableWriterArchiveImpl<Holder>();
1493  break;
1494  case kScriptWspecifier:
1495  impl_ = new TableWriterScriptImpl<Holder>();
1496  break;
1497  case kNoWspecifier: default:
1498  KALDI_WARN << "ClassifyWspecifier: invalid wspecifier " << wspecifier;
1499  return false;
1500  }
1501  if (impl_->Open(wspecifier)) {
1502  return true;
1503  } else { // The class will have printed a more specific warning.
1504  delete impl_;
1505  impl_ = NULL;
1506  return false;
1507  }
1508 }
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_WARN
Definition: kaldi-error.h:150
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:185
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ Open() [4/4]

bool Open ( const std::string &  table_rxfilename,
const std::string &  utt2spk_rxfilename 
)

Note: when calling Open, utt2spk_rxfilename may be empty.

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

References KALDI_ASSERT, RandomAccessTableReaderMapped< Holder >::reader_, and RandomAccessTableReaderMapped< Holder >::token_reader_.

Referenced by main().

2616  {
2617  if (reader_.IsOpen()) reader_.Close();
2618  if (token_reader_.IsOpen()) token_reader_.Close();
2619  KALDI_ASSERT(!table_rxfilename.empty());
2620  if (!reader_.Open(table_rxfilename)) return false; // will have printed
2621  // warning internally, probably.
2622  if (!utt2spk_rxfilename.empty()) {
2623  if (!token_reader_.Open(utt2spk_rxfilename)) {
2624  reader_.Close();
2625  return false;
2626  }
2627  }
2628  return true;
2629 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:461
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185

◆ RandomAccessTableReader()

RandomAccessTableReader ( const std::string &  rspecifier)
explicit

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

2509  :
2510  impl_(NULL) {
2511  if (rspecifier != "" && !Open(rspecifier))
2512  KALDI_ERR << "Error opening RandomAccessTableReader object "
2513  " (rspecifier is: " << rspecifier << ")";
2514 }
bool Open(const std::string &rspecifier)
#define KALDI_ERR
Definition: kaldi-error.h:147
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279

◆ RandomAccessTableReaderMapped()

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 2606 of file kaldi-table-inl.h.

2608  :
2609  reader_(table_rxfilename), token_reader_(table_rxfilename.empty() ? "" :
2610  utt2spk_rxfilename),
2611  utt2spk_rxfilename_(utt2spk_rxfilename) { }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:461
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460

◆ SequentialTableReader()

SequentialTableReader ( const std::string &  rspecifier)
explicit

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

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

858  : impl_(NULL) {
859  if (rspecifier != "" && !Open(rspecifier))
860  KALDI_ERR << "Error constructing TableReader: rspecifier is " << rspecifier;
861 }
bool Open(const std::string &rspecifier)
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361
#define KALDI_ERR
Definition: kaldi-error.h:147

◆ TableWriter()

TableWriter ( const std::string &  wspecifier)
explicit

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

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

1467  : impl_(NULL) {
1468  if (wspecifier != "" && !Open(wspecifier))
1469  KALDI_ERR << "Failed to open table for writing with wspecifier: " << wspecifier
1470  << ": errno (in case it's relevant) is: " << strerror(errno);
1471 }
bool Open(const std::string &wspecifier)
#define KALDI_ERR
Definition: kaldi-error.h:147
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ Value() [1/3]

◆ Value() [2/3]

SequentialTableReader< Holder >::T & Value ( )

◆ Value() [3/3]

const Holder::T & Value ( const std::string &  key)

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

References KALDI_ERR, kaldi::PrintableRxfilename(), RandomAccessTableReaderMapped< Holder >::reader_, RandomAccessTableReaderMapped< Holder >::token_reader_, and RandomAccessTableReaderMapped< Holder >::utt2spk_rxfilename_.

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

2651  {
2652  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2653  if (!token_reader_.HasKey(utt))
2654  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2655  << "in utt2spk map or similar map being read from "
2657  const std::string &spk = token_reader_.Value(utt);
2658  return reader_.Value(spk);
2659  } else {
2660  return reader_.Value(utt);
2661  }
2662 }
RandomAccessTableReader< TokenHolder > token_reader_
Definition: kaldi-table.h:461
#define KALDI_ERR
Definition: kaldi-error.h:147
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460
std::string PrintableRxfilename(const std::string &rxfilename)
PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting...
Definition: kaldi-io.cc:61

◆ Write()

void Write ( const std::string &  key,
const T value 
) const
inline

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

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

Referenced by kaldi::AlignUtteranceWrapper(), ComputeLogPosteriors(), CopyExcludedFeats(), CopyIncludedFeats(), kaldi::CopySubsetLattices(), kaldi::DecodeUtterance(), DecodeUtterance(), kaldi::DecodeUtteranceLatticeFaster(), kaldi::DecodeUtteranceLatticeIncremental(), kaldi::DecodeUtteranceLatticeSimple(), kaldi::HandleOutput(), main(), OutputDetailedStatistics(), kaldi::nnet2::ProcessFile(), kaldi::nnet3::ProcessFile(), kaldi::RunPerSpeaker(), kaldi::TestCompactLatticeTable(), kaldi::TestCompactLatticeTableCross(), kaldi::TestLatticeTable(), kaldi::TestLatticeTableCross(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), 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(), DiscriminativeExampleMerger::WriteMinibatch(), ChainExampleMerger::WriteMinibatch(), ExampleMerger::WriteMinibatch(), DecodeUtteranceLatticeFasterClass::~DecodeUtteranceLatticeFasterClass(), DeterminizeLatticeTask::~DeterminizeLatticeTask(), and IvectorExtractTask::~IvectorExtractTask().

1512  {
1513  CheckImpl();
1514  if (!impl_->Write(key, value))
1515  KALDI_ERR << "Error in TableWriter::Write";
1516  // More specific warning will have
1517  // been printed in the Write function.
1518 }
#define KALDI_ERR
Definition: kaldi-error.h:147
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:414

◆ ~RandomAccessTableReader()

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

2576  {
2577  if (IsOpen() && !Close()) // call Close() yourself to stop this being thrown.
2578  KALDI_ERR << "failure detected in destructor.";
2579 }
#define KALDI_ERR
Definition: kaldi-error.h:147

◆ ~SequentialTableReader()

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

References SequentialTableReader< Holder >::impl_.

955  {
956  delete impl_;
957  // Destructor of impl_ may throw.
958 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:361

◆ ~TableWriter()

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

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

1537  {
1538  if (IsOpen() && !Close()) {
1539  KALDI_ERR << "Error closing TableWriter [in destructor].";
1540  }
1541 }
#define KALDI_ERR
Definition: kaldi-error.h:147