diff options
author | 2012-06-30 08:53:33 +0900 | |
---|---|---|
committer | 2012-07-02 20:20:42 +0900 | |
commit | 8658e552f350167bb8f5af7b9e991775f2cc6a6d (patch) | |
tree | dd2045310f65d25f74ad9ef390595620b72a397a /native/jni/src/gesture/impl/incremental_decoder_impl.cpp | |
parent | 26c45718a595e96a3fffd4fc6307e926a8c2ad70 (diff) | |
download | latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.tar.gz latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.tar.xz latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.zip |
Makefile and source code structure update for LatinIME AOSP build
Change-Id: Ia2ab54651ef96521fce01fe4755147909b818803
Diffstat (limited to 'native/jni/src/gesture/impl/incremental_decoder_impl.cpp')
-rw-r--r-- | native/jni/src/gesture/impl/incremental_decoder_impl.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/native/jni/src/gesture/impl/incremental_decoder_impl.cpp b/native/jni/src/gesture/impl/incremental_decoder_impl.cpp index b7e8b3bd1..f2b76ed26 100644 --- a/native/jni/src/gesture/impl/incremental_decoder_impl.cpp +++ b/native/jni/src/gesture/impl/incremental_decoder_impl.cpp @@ -15,7 +15,26 @@ */ #include "incremental_decoder_impl.h" +#include "incremental_decoder_interface.h" namespace latinime { + +// A factory method for IncrementalDecoderImpl +static IncrementalDecoderInterface *getDecoderInstance(int maxWordLength, int maxWords) { + return new IncrementalDecoderImpl(maxWordLength, maxWords); +} + +// An ad-hoc internal class to register the factory method defined above +class IncrementalDecoderFactoryRegisterer { + public: + IncrementalDecoderFactoryRegisterer() { + IncrementalDecoderInterface::setIncrementalDecoderFactoryMethod(getDecoderInstance); + } + private: + DISALLOW_COPY_AND_ASSIGN(IncrementalDecoderFactoryRegisterer); }; -// namespace latinime + +// To invoke the IncrementalDecoderFactoryRegisterer constructor in the global constructor +// Not sure, but can be static? +IncrementalDecoderFactoryRegisterer incrementalDecoderFactoryRegisterer; +} // namespace latinime |