Welcome to mirror list, hosted at ThFree Co, Russian Federation.

HypothesisStack.cpp « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 418f129bc4581a3bb8495dc6da7f011e07115586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include "HypothesisStack.h"

namespace Moses
{
HypothesisStack::~HypothesisStack()
{
  // delete all hypos
  while (m_hypos.begin() != m_hypos.end()) {
    Remove(m_hypos.begin());
  }
}

/** Remove hypothesis pointed to by iterator but don't delete the object. */
void HypothesisStack::Detach(const HypothesisStack::iterator &iter)
{
  m_hypos.erase(iter);
}


void HypothesisStack::Remove(const HypothesisStack::iterator &iter)
{
  Hypothesis *h = *iter;
  Detach(iter);
  delete h;
}


}