1 /*
2  * Copyright (C) 2013, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * !!!!! DO NOT EDIT THIS FILE !!!!!
19  *
20  * This file was generated from
21  *   dictionary/structure/v4/ver4_patricia_trie_node_reader.h
22  */
23 
24 #ifndef LATINIME_BACKWARD_V402_VER4_PATRICIA_TRIE_NODE_READER_H
25 #define LATINIME_BACKWARD_V402_VER4_PATRICIA_TRIE_NODE_READER_H
26 
27 #include "defines.h"
28 #include "dictionary/structure/pt_common/pt_node_params.h"
29 #include "dictionary/structure/pt_common/pt_node_reader.h"
30 
31 namespace latinime {
32 namespace backward {
33 namespace v402 {
34 
35 } // namespace v402
36 } // namespace backward
37 class BufferWithExtendableBuffer;
38 namespace backward {
39 namespace v402 {
40 } // namespace v402
41 } // namespace backward
42 class HeaderPolicy;
43 namespace backward {
44 namespace v402 {
45 class ProbabilityDictContent;
46 
47 /*
48  * This class is used for helping to read nodes of ver4 patricia trie. This class handles moved
49  * node and reads node attributes including probability form probabilityBuffer.
50  */
51 class Ver4PatriciaTrieNodeReader : public PtNodeReader {
52  public:
Ver4PatriciaTrieNodeReader(const BufferWithExtendableBuffer * const buffer,const ProbabilityDictContent * const probabilityDictContent,const HeaderPolicy * const headerPolicy)53     Ver4PatriciaTrieNodeReader(const BufferWithExtendableBuffer *const buffer,
54             const ProbabilityDictContent *const probabilityDictContent,
55             const HeaderPolicy *const headerPolicy)
56             : mBuffer(buffer), mProbabilityDictContent(probabilityDictContent),
57               mHeaderPolicy(headerPolicy) {}
58 
~Ver4PatriciaTrieNodeReader()59     ~Ver4PatriciaTrieNodeReader() {}
60 
fetchPtNodeParamsInBufferFromPtNodePos(const int ptNodePos)61     virtual const PtNodeParams fetchPtNodeParamsInBufferFromPtNodePos(const int ptNodePos) const {
62         return fetchPtNodeInfoFromBufferAndProcessMovedPtNode(ptNodePos,
63                 NOT_A_DICT_POS /* siblingNodePos */);
64     }
65 
66  private:
67     DISALLOW_COPY_AND_ASSIGN(Ver4PatriciaTrieNodeReader);
68 
69     const BufferWithExtendableBuffer *const mBuffer;
70     const ProbabilityDictContent *const mProbabilityDictContent;
71     const HeaderPolicy *const mHeaderPolicy;
72 
73     const PtNodeParams fetchPtNodeInfoFromBufferAndProcessMovedPtNode(const int ptNodePos,
74             const int siblingNodePos) const;
75 };
76 } // namespace v402
77 } // namespace backward
78 } // namespace latinime
79 #endif /* LATINIME_BACKWARD_V402_VER4_PATRICIA_TRIE_NODE_READER_H */
80