aboutsummaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-10-10 05:39:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-10 05:39:57 +0000
commit229f354fdc2ff98dd6b1132ef5a5bd364c065079 (patch)
tree1b412fee37839592c12bd4f02a3086e28c451ef5 /native
parent701b14ffa604df48bdc5c6287c9ba296ef8a02db (diff)
parent620ebde70490473fd3562f70d1f24d7d53b6fb1c (diff)
downloadlatinime-229f354fdc2ff98dd6b1132ef5a5bd364c065079.tar.gz
latinime-229f354fdc2ff98dd6b1132ef5a5bd364c065079.tar.xz
latinime-229f354fdc2ff98dd6b1132ef5a5bd364c065079.zip
Merge "Make members of classes that are used with std::vector const"
Diffstat (limited to 'native')
-rw-r--r--native/jni/src/suggest/core/dictionary/property/historical_info.h10
-rw-r--r--native/jni/src/suggest/core/dictionary/property/ngram_property.h10
-rw-r--r--native/jni/src/suggest/core/dictionary/property/unigram_property.h20
3 files changed, 19 insertions, 21 deletions
diff --git a/native/jni/src/suggest/core/dictionary/property/historical_info.h b/native/jni/src/suggest/core/dictionary/property/historical_info.h
index 5ed9ebfca..f9bd6fd8c 100644
--- a/native/jni/src/suggest/core/dictionary/property/historical_info.h
+++ b/native/jni/src/suggest/core/dictionary/property/historical_info.h
@@ -47,12 +47,12 @@ class HistoricalInfo {
}
private:
- // Default copy constructor and assign operator are used for using in std::vector.
+ // Default copy constructor is used for using in std::vector.
+ DISALLOW_ASSIGNMENT_OPERATOR(HistoricalInfo);
- // TODO: Make members const.
- int mTimestamp;
- int mLevel;
- int mCount;
+ const int mTimestamp;
+ const int mLevel;
+ const int mCount;
};
} // namespace latinime
#endif /* LATINIME_HISTORICAL_INFO_H */
diff --git a/native/jni/src/suggest/core/dictionary/property/ngram_property.h b/native/jni/src/suggest/core/dictionary/property/ngram_property.h
index dce460099..8709799f9 100644
--- a/native/jni/src/suggest/core/dictionary/property/ngram_property.h
+++ b/native/jni/src/suggest/core/dictionary/property/ngram_property.h
@@ -44,13 +44,13 @@ class NgramProperty {
}
private:
- // Default copy constructor and assign operator are used for using in std::vector.
+ // Default copy constructor is used for using in std::vector.
DISALLOW_DEFAULT_CONSTRUCTOR(NgramProperty);
+ DISALLOW_ASSIGNMENT_OPERATOR(NgramProperty);
- // TODO: Make members const.
- std::vector<int> mTargetCodePoints;
- int mProbability;
- HistoricalInfo mHistoricalInfo;
+ const std::vector<int> mTargetCodePoints;
+ const int mProbability;
+ const HistoricalInfo mHistoricalInfo;
};
} // namespace latinime
#endif // LATINIME_NGRAM_PROPERTY_H
diff --git a/native/jni/src/suggest/core/dictionary/property/unigram_property.h b/native/jni/src/suggest/core/dictionary/property/unigram_property.h
index d1f0ab4ca..5ed2e2602 100644
--- a/native/jni/src/suggest/core/dictionary/property/unigram_property.h
+++ b/native/jni/src/suggest/core/dictionary/property/unigram_property.h
@@ -41,12 +41,11 @@ class UnigramProperty {
}
private:
- // Default copy constructor and assign operator are used for using in std::vector.
+ // Default copy constructor is used for using in std::vector.
DISALLOW_DEFAULT_CONSTRUCTOR(ShortcutProperty);
- // TODO: Make members const.
- std::vector<int> mTargetCodePoints;
- int mProbability;
+ const std::vector<int> mTargetCodePoints;
+ const int mProbability;
};
UnigramProperty()
@@ -104,13 +103,12 @@ class UnigramProperty {
// Default copy constructor is used for using as a return value.
DISALLOW_ASSIGNMENT_OPERATOR(UnigramProperty);
- // TODO: Make members const.
- bool mRepresentsBeginningOfSentence;
- bool mIsNotAWord;
- bool mIsBlacklisted;
- int mProbability;
- HistoricalInfo mHistoricalInfo;
- std::vector<ShortcutProperty> mShortcuts;
+ const bool mRepresentsBeginningOfSentence;
+ const bool mIsNotAWord;
+ const bool mIsBlacklisted;
+ const int mProbability;
+ const HistoricalInfo mHistoricalInfo;
+ const std::vector<ShortcutProperty> mShortcuts;
};
} // namespace latinime
#endif // LATINIME_UNIGRAM_PROPERTY_H