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

anonymous enum
private
Enumerator
kUninitialized 
kReadScript 
kNotReadScript 

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

anonymous enum
private
Enumerator
kUninitialized 
kOpen 
kWriteError 

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

1458  { // is stream open?
1459  kUninitialized, // no
1460  kOpen, // yes
1461  kWriteError, // yes
1462  } state_;
enum kaldi::TableWriterBothImpl::@3 state_
anonymous enum
private
Enumerator
kUninitialized 
kNotReadScript 
kNotHaveObject 
kHaveObject 
kHaveRange 

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

1863  {
1864  // (*) is script_ set up?
1865  // (*) does holder_ contain an object?
1866  // (*) does range_holder_ contain and object?
1867  //
1868  //
1869  kUninitialized, // no no no
1870  kNotReadScript, // no no no
1871  kNotHaveObject, // yes no no
1872  kHaveObject, // yes yes no
1873  kHaveRange, // yes yes yes
1874 
1875  // If we are in a state where holder_ contains an object, it always contains
1876  // the object from 'key_', and the corresponding rxfilename is always
1877  // 'data_rxfilename_'. If range_holder_ contains an object, it always
1878  // corresponds to the range 'range_' of the object in 'holder_', and always
1879  // corresponds to the current key.
1880  } state_;
enum kaldi::RandomAccessTableReaderScriptImpl::@4 state_
anonymous enum
protected
Enumerator
kUninitialized 
kNoObject 
kHaveObject 
kEof 
kError 

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

2031  { // [The state of the reading process] [does holder_ [is input_
2032  // have object] open]
2033  kUninitialized, // Uninitialized or closed no no
2034  kNoObject, // Do not have object in holder_ no yes
2035  kHaveObject, // Have object in holder_ yes yes
2036  kEof, // End of file no yes
2037  kError, // Some kind of error-state in the reading. no yes
2038  } 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 2590 of file kaldi-table-inl.h.

References KALDI_ERR.

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:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
void CheckImpl ( ) const
private

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

References KALDI_ERR.

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:359
#define KALDI_ERR
Definition: kaldi-error.h:127
void CheckImpl ( ) const
private

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

References KALDI_ERR.

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:127
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
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
void Flush ( )

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

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

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

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

926  {
927  CheckImpl();
928  impl_->FreeCurrent();
929 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
bool HasKey ( const std::string &  key)

Definition at line 2551 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().

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:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
bool HasKey ( const std::string &  key)

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

References KALDI_ERR, and kaldi::PrintableRxfilename().

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

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:359
bool Open ( const std::string &  rspecifier)

Definition at line 2517 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().

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

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

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

References KALDI_ASSERT.

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

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

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: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 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:460
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:459
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:359
#define KALDI_ERR
Definition: kaldi-error.h:127
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:127
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
const Holder::T & Value ( const std::string &  key)

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

References KALDI_ERR, and kaldi::PrintableRxfilename().

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: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 1511 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(), OutputDetailedStatistics(), 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(), DiscriminativeExampleMerger::WriteMinibatch(), ChainExampleMerger::WriteMinibatch(), ExampleMerger::WriteMinibatch(), DecodeUtteranceLatticeFasterClass::~DecodeUtteranceLatticeFasterClass(), DeterminizeLatticeTask::~DeterminizeLatticeTask(), IvectorExtractTask::~IvectorExtractTask(), and NnetLogprobTask::~NnetLogprobTask().

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:127
void CheckImpl() const
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
~RandomAccessTableReader ( )

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

References KALDI_ERR.

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:127
~SequentialTableReader ( )

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

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

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

References KALDI_ERR.

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