File size: 595 Bytes
fd49381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#pragma once

#include <sstream>
#include "FFState.h"

namespace Moses2
{

struct PointerState: public FFState {
  const void* lmstate;

  explicit PointerState() {
    // uninitialised
  }

  PointerState(const void* lms) {
    lmstate = lms;
  }
  virtual size_t hash() const {
    return (size_t) lmstate;
  }
  virtual bool operator==(const FFState& other) const {
    const PointerState& o = static_cast<const PointerState&>(other);
    return lmstate == o.lmstate;
  }

  virtual std::string ToString() const {
    std::stringstream sb;
    sb << lmstate;
    return sb.str();
  }

};

}