File size: 853 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Stacks.h
 *
 *  Created on: 6 Nov 2015
 *      Author: hieu
 */

#pragma once

#include <vector>
#include "Stack.h"
#include "../../Recycler.h"

namespace Moses2
{
class Manager;
class ArcLists;

namespace NSNormal
{

class Stacks
{
public:
  Stacks(const Manager &mgr);
  virtual ~Stacks();

  void Init(const Manager &mgr, 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(Hypothesis *hypo, Recycler<HypothesisBase*> &hypoRecycle,
           ArcLists &arcLists);

  std::string Debug(const System &system) const;

protected:
  const Manager &m_mgr;
  std::vector<Stack*> m_stacks;
};

}
}