00001 00002 #include "HypothesisStack.h" 00003 00004 namespace Moses 00005 { 00006 HypothesisStack::~HypothesisStack() 00007 { 00008 // delete all hypos 00009 while (m_hypos.begin() != m_hypos.end()) { 00010 Remove(m_hypos.begin()); 00011 } 00012 } 00013 00015 void HypothesisStack::Detach(const HypothesisStack::iterator &iter) 00016 { 00017 m_hypos.erase(iter); 00018 } 00019 00020 00021 void HypothesisStack::Remove(const HypothesisStack::iterator &iter) 00022 { 00023 Hypothesis *h = *iter; 00024 Detach(iter); 00025 delete h; 00026 } 00027 00028 00029 } 00030