diff options
author | 2012-07-02 04:43:48 -0700 | |
---|---|---|
committer | 2012-07-02 04:43:48 -0700 | |
commit | 83649cb400797d6382218d99fe496a080aa4a026 (patch) | |
tree | b4e75eadc64f5b7ed0be8f42f032262c9189ab64 /native/jni/src/gesture/impl/incremental_decoder_impl.cpp | |
parent | d6496c091392481850c7d0103b19bc9619459d08 (diff) | |
parent | 8658e552f350167bb8f5af7b9e991775f2cc6a6d (diff) | |
download | latinime-83649cb400797d6382218d99fe496a080aa4a026.tar.gz latinime-83649cb400797d6382218d99fe496a080aa4a026.tar.xz latinime-83649cb400797d6382218d99fe496a080aa4a026.zip |
Merge "Makefile and source code structure update for LatinIME AOSP build"
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 |