diff options
author | Rico Sennrich <rico.sennrich@gmx.ch> | 2014-04-04 18:54:48 +0400 |
---|---|---|
committer | Rico Sennrich <rico.sennrich@gmx.ch> | 2014-04-04 18:54:48 +0400 |
commit | 395285d879e63042e29e3ad3a7c71a9bf16aa586 (patch) | |
tree | 9d08fc314f0a91fe5e6a9ddaa7d261056f22ed03 /search/header.hh | |
parent | 59098ac66492bd62f40813b72e0aadca3963caf1 (diff) |
more logging for incremental chart search
Diffstat (limited to 'search/header.hh')
-rw-r--r-- | search/header.hh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/search/header.hh b/search/header.hh index 69f0eed04..d70524097 100644 --- a/search/header.hh +++ b/search/header.hh @@ -1,9 +1,10 @@ #ifndef SEARCH_HEADER__ #define SEARCH_HEADER__ -// Header consisting of Score, Arity, and Note +// Header consisting of Score, Arity, Note and WordsRange #include "search/types.hh" +#include "moses/WordsRange.h" #include <stdint.h> @@ -38,6 +39,13 @@ class Header { *reinterpret_cast<Note*>(base_ + sizeof(Score) + sizeof(Arity)) = to; } + Moses::WordsRange GetRange() const { + return *reinterpret_cast<const Moses::WordsRange*>(base_ + sizeof(Score) + sizeof(Arity) + sizeof(Note)); + } + void SetRange(Moses::WordsRange to) { + *reinterpret_cast<Moses::WordsRange*>(base_ + sizeof(Score) + sizeof(Arity) + sizeof(Note)) = to; + } + uint8_t *Base() { return base_; } const uint8_t *Base() const { return base_; } @@ -50,7 +58,7 @@ class Header { *reinterpret_cast<Arity*>(base_ + sizeof(Score)) = arity; } - static const std::size_t kHeaderSize = sizeof(Score) + sizeof(Arity) + sizeof(Note); + static const std::size_t kHeaderSize = sizeof(Score) + sizeof(Arity) + sizeof(Note) + sizeof(Moses::WordsRange); uint8_t *After() { return base_ + kHeaderSize; } const uint8_t *After() const { return base_ + kHeaderSize; } |