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

References KALDI_ERR.

2606  {
2607  if (!impl_) {
2608  KALDI_ERR << "Trying to use empty RandomAccessTableReader (perhaps you "
2609  << "passed the empty string as an argument to a program?)";
2610  }
2611 }
#define KALDI_ERR
Definition: kaldi-error.h:127
RandomAccessTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:279
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 SequentialTableReader (perhaps you "
2601  << "passed the empty string as an argument to a program?)";
2602  }
2603 }
SequentialTableReaderImplBase< Holder > * impl_
Definition: kaldi-table.h:359
#define KALDI_ERR
Definition: kaldi-error.h:127
void CheckImpl ( ) const
private

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

References KALDI_ERR.

2614  {
2615  if (!impl_) {
2616  KALDI_ERR << "Trying to use empty TableWriter (perhaps you "
2617  << "passed the empty string as an argument to a program?)";
2618  }
2619 }
#define KALDI_ERR
Definition: kaldi-error.h:127
TableWriterImplBase< Holder > * impl_
Definition: kaldi-table.h:413
bool Close ( )

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

2583  {
2584  CheckImpl();
2585  bool ans =impl_->Close();
2586  delete impl_;
2587  impl_ = NULL;
2588  return ans;
2589 }
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 2567 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().

2567  {
2568  CheckImpl();
2569  if (!IsToken(key))
2570  KALDI_ERR << "Invalid key \"" << key << '"';
2571  return impl_->HasKey(key);
2572 }
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 2649 of file kaldi-table-inl.h.

References KALDI_ERR, and kaldi::PrintableRxfilename().

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

2649  {
2650  // We don't check IsOpen, we let the call go through to the member variable
2651  // (reader_), which will crash with a more informative error message than
2652  // we can give here, as we don't any longer know the rxfilename.
2653  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2654  if (!token_reader_.HasKey(utt))
2655  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2656  << "in utt2spk map or similar map being read from "
2658  const std::string &spk = token_reader_.Value(utt);
2659  return reader_.HasKey(spk);
2660  } else {
2661  return reader_.HasKey(utt);
2662  }
2663 }
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 2533 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().

2533  {
2534  if (IsOpen())
2535  KALDI_ERR << "Already open.";
2536  RspecifierOptions opts;
2537  RspecifierType rs = ClassifyRspecifier(rspecifier, NULL, &opts);
2538  switch (rs) {
2539  case kScriptRspecifier:
2540  impl_ = new RandomAccessTableReaderScriptImpl<Holder>();
2541  break;
2542  case kArchiveRspecifier:
2543  if (opts.sorted) {
2544  if (opts.called_sorted) // "doubly" sorted case.
2545  impl_ = new RandomAccessTableReaderDSortedArchiveImpl<Holder>();
2546  else
2547  impl_ = new RandomAccessTableReaderSortedArchiveImpl<Holder>();
2548  } else {
2549  impl_ = new RandomAccessTableReaderUnsortedArchiveImpl<Holder>();
2550  }
2551  break;
2552  case kNoRspecifier: default:
2553  KALDI_WARN << "Invalid rspecifier: "
2554  << rspecifier;
2555  return false;
2556  }
2557  if (!impl_->Open(rspecifier)) {
2558  // A warning will already have been printed.
2559  delete impl_;
2560  impl_ = NULL;
2561  return false;
2562  }
2563  return true;
2564 }
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 2630 of file kaldi-table-inl.h.

References KALDI_ASSERT.

Referenced by main().

2632  {
2633  if (reader_.IsOpen()) reader_.Close();
2634  if (token_reader_.IsOpen()) token_reader_.Close();
2635  KALDI_ASSERT(!table_rxfilename.empty());
2636  if (!reader_.Open(table_rxfilename)) return false; // will have printed
2637  // warning internally, probably.
2638  if (!utt2spk_rxfilename.empty()) {
2639  if (!token_reader_.Open(utt2spk_rxfilename)) {
2640  reader_.Close();
2641  return false;
2642  }
2643  }
2644  return true;
2645 }
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 2524 of file kaldi-table-inl.h.

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

2525  :
2526  impl_(NULL) {
2527  if (rspecifier != "" && !Open(rspecifier))
2528  KALDI_ERR << "Error opening RandomAccessTableReader object "
2529  " (rspecifier is: " << rspecifier << ")";
2530 }
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 2622 of file kaldi-table-inl.h.

2624  :
2625  reader_(table_rxfilename), token_reader_(table_rxfilename.empty() ? "" :
2626  utt2spk_rxfilename),
2627  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 2666 of file kaldi-table-inl.h.

References KALDI_ERR, and kaldi::PrintableRxfilename().

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

2667  {
2668  if (token_reader_.IsOpen()) { // We need to map the key from utt to spk.
2669  if (!token_reader_.HasKey(utt))
2670  KALDI_ERR << "Attempting to read key " << utt << ", which is not present "
2671  << "in utt2spk map or similar map being read from "
2673  const std::string &spk = token_reader_.Value(utt);
2674  return reader_.Value(spk);
2675  } else {
2676  return reader_.Value(utt);
2677  }
2678 }
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(), 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().

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

References KALDI_ERR.

2592  {
2593  if (IsOpen() && !Close()) // call Close() yourself to stop this being thrown.
2594  KALDI_ERR << "failure detected in destructor.";
2595 }
#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