/* * Stack.h * * Created on: 24 Oct 2015 * Author: hieu */ #pragma once #include #include #include #include "../Hypothesis.h" #include "../../TypeDef.h" #include "../../Vector.h" #include "../../MemPool.h" #include "../../MemPoolAllocator.h" #include "../../Recycler.h" #include "../../HypothesisColl.h" #include "../../legacy/Util2.h" namespace Moses2 { class Manager; class HypothesisBase; class ArcLists; namespace NSCubePruningMiniStack { class Stack { protected: public: typedef std::pair HypoCoverage; // bitmap and current endPos of hypos typedef boost::unordered_map, std::equal_to, MemPoolAllocator > > Coll; Stack(const Manager &mgr); virtual ~Stack(); size_t GetHypoSize() const; Coll &GetColl() { return m_coll; } const Coll &GetColl() const { return m_coll; } void Add(Hypothesis *hypo, Recycler &hypoRecycle, ArcLists &arcLists); Moses2::HypothesisColl &GetMiniStack(const HypoCoverage &key); const Hypothesis *GetBestHypo() const; void Clear(); void DebugCounts(); protected: const Manager &m_mgr; Coll m_coll; std::deque > m_miniStackRecycler; }; } }