blob: dfa03108ec6700ee279f337c58bf0c44cf6a13c0 (
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);
FREEHYPO(h);
}
}
|