Add Delete()

This commit is contained in:
Hieu Hoang 2016-03-31 19:36:33 +01:00
parent 98a0e40377
commit ae5286f220
2 changed files with 12 additions and 2 deletions

View File

@ -88,9 +88,18 @@ void ArcLists::Sort()
BOOST_FOREACH(Coll::value_type &collPair, m_coll) {
ArcList &list = *collPair.second;
std::sort(list.begin(), list.end(), HypothesisFutureScoreOrderer() );
}
}
void ArcLists::Delete(const HypothesisBase *hypo)
{
Coll::iterator iter = m_coll.find(hypo);
UTIL_THROW_IF2(iter == m_coll.end(), "Can't find arc list");
ArcList *arcList = iter->second;
m_coll.erase(iter);
delete arcList;
}
}

View File

@ -20,8 +20,9 @@ public:
ArcLists();
virtual ~ArcLists();
void AddArc(bool added, const HypothesisBase *currHypo,const HypothesisBase *otherHypo);
void AddArc(bool added, const HypothesisBase *currHypo, const HypothesisBase *otherHypo);
void Sort();
void Delete(const HypothesisBase *hypo);
const ArcList *GetArcList(const HypothesisBase *hypo) const;