mosesdecoder/contrib/other-builds/moses2/Search/Stacks.h
2016-01-18 15:37:04 +00:00

47 lines
718 B
C++

/*
* Stacks.h
*
* Created on: 6 Nov 2015
* Author: hieu
*/
#pragma once
#include <vector>
#include "Stack.h"
#include "../Recycler.h"
namespace Moses2
{
class Stacks {
friend std::ostream& operator<<(std::ostream &, const Stacks &);
public:
Stacks();
virtual ~Stacks();
void Init(size_t numStacks);
size_t GetSize() const
{ return m_stacks.size(); }
const Stack &Back() const
{ return *m_stacks.back(); }
Stack &operator[](size_t ind)
{ return *m_stacks[ind]; }
void Delete(size_t ind) {
delete m_stacks[ind];
m_stacks[ind] = NULL;
}
void Add(const Hypothesis *hypo, Recycler<Hypothesis*> &hypoRecycle);
protected:
std::vector<Stack*> m_stacks;
};
}