Merge "Add getter methods for public member variables."

This commit is contained in:
Keisuke Kuroyanagi 2014-03-10 11:40:24 +00:00 committed by Android (Google) Code Review
commit 5c2f55fe6e
4 changed files with 14 additions and 10 deletions

View file

@ -36,7 +36,7 @@
#define DUMP_WORD_AND_SCORE(header) \
do { char charBuf[50]; char prevWordCharBuf[50]; \
INTS_TO_CHARS(getOutputWordBuf(), getNodeCodePointCount(), charBuf, NELEMS(charBuf)); \
INTS_TO_CHARS(mDicNodeState.mDicNodeStatePrevWord.mPrevWord, \
INTS_TO_CHARS(mDicNodeState.mDicNodeStatePrevWord.getPrevWordBuf(), \
mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength(), prevWordCharBuf, \
NELEMS(prevWordCharBuf)); \
AKLOGI("#%8s, %5f, %5f, %5f, %5f, %s, %s, %d, %5f,", header, \
@ -313,7 +313,7 @@ class DicNode {
void outputResult(int *dest) const {
const uint16_t prevWordLength = mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength();
const uint16_t currentDepth = getNodeCodePointCount();
DicNodeUtils::appendTwoWords(mDicNodeState.mDicNodeStatePrevWord.mPrevWord,
DicNodeUtils::appendTwoWords(mDicNodeState.mDicNodeStatePrevWord.getPrevWordBuf(),
prevWordLength, getOutputWordBuf(), currentDepth, dest);
DUMP_WORD_AND_SCORE("OUTPUT");
}
@ -324,7 +324,7 @@ class DicNode {
// are concatenated together in mPrevWord - which contains a space at the end.
int getTotalNodeSpaceCount() const {
if (isFirstWord()) return 0;
return CharUtils::getSpaceCount(mDicNodeState.mDicNodeStatePrevWord.mPrevWord,
return CharUtils::getSpaceCount(mDicNodeState.mDicNodeStatePrevWord.getPrevWordBuf(),
mDicNodeState.mDicNodeStatePrevWord.getPrevWordLength());
}
@ -376,7 +376,7 @@ class DicNode {
}
AK_FORCE_INLINE const int *getOutputWordBuf() const {
return mDicNodeState.mDicNodeStateOutput.mCodePointsBuf;
return mDicNodeState.mDicNodeStateOutput.getCodePointBuf();
}
int getPrevCodePointG(int pointerId) const {

View file

@ -68,9 +68,9 @@ class DicNodeState {
mDicNodeStatePrevWord.init(
prevWordDicNodeState->mDicNodeStatePrevWord.getPrevWordCount() + 1,
prevWordPos,
prevWordDicNodeState->mDicNodeStatePrevWord.mPrevWord,
prevWordDicNodeState->mDicNodeStatePrevWord.getPrevWordBuf(),
prevWordDicNodeState->mDicNodeStatePrevWord.getPrevWordLength(),
prevWordDicNodeState->mDicNodeStateOutput.mCodePointsBuf,
prevWordDicNodeState->mDicNodeStateOutput.getCodePointBuf(),
prevWordCodePointCount,
prevWordDicNodeState->mDicNodeStatePrevWord.getSecondWordFirstInputIndex(),
prevWordDicNodeState->mDicNodeStateInput.getInputIndex(0) /* lastInputIndex */);

View file

@ -66,13 +66,15 @@ class DicNodeStateOutput {
return mCodePointsBuf[index];
}
// TODO: Move to private
int mCodePointsBuf[MAX_WORD_LENGTH];
const int *getCodePointBuf() const {
return mCodePointsBuf;
}
private:
DISALLOW_COPY_AND_ASSIGN(DicNodeStateOutput);
uint16_t mOutputtedCodePointCount;
int mCodePointsBuf[MAX_WORD_LENGTH];
};
} // namespace latinime
#endif // LATINIME_DIC_NODE_STATE_OUTPUT_H

View file

@ -123,8 +123,9 @@ class DicNodeStatePrevWord {
return true;
}
// TODO: Move to private
int mPrevWord[MAX_WORD_LENGTH];
const int *getPrevWordBuf() const {
return mPrevWord;
}
private:
DISALLOW_COPY_AND_ASSIGN(DicNodeStatePrevWord);
@ -134,6 +135,7 @@ class DicNodeStatePrevWord {
int16_t mPrevWordStart;
int mPrevWordPtNodePos;
int mSecondWordFirstInputIndex;
int mPrevWord[MAX_WORD_LENGTH];
};
} // namespace latinime
#endif // LATINIME_DIC_NODE_STATE_PREVWORD_H