File size: 806 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
/*
 * ArcList.h
 *
 *  Created on: 26 Oct 2015
 *      Author: hieu
 */
#pragma once
#include <vector>
#include <boost/unordered_map.hpp>

namespace Moses2
{
class System;

class HypothesisBase;

typedef std::vector<const HypothesisBase*> ArcList;

class ArcLists
{
public:
  ArcLists();
  virtual ~ArcLists();

  void AddArc(bool added, const HypothesisBase *currHypo,
              const HypothesisBase *otherHypo);
  void Sort();
  void Delete(const HypothesisBase *hypo);

  const ArcList &GetArcList(const HypothesisBase *hypo) const;

  std::string Debug(const System &system) const;
protected:
  typedef boost::unordered_map<const HypothesisBase*, ArcList*> Coll;
  Coll m_coll;

  ArcList &GetArcList(const HypothesisBase *hypo);
  ArcList &GetAndDetachArcList(const HypothesisBase *hypo);

};

}