Problems I want to solve:
1. Code duplication - [this part of code](https://github.com/CommE2E/comm/blob/7a6f37fbccf9a419ccdb45fc09d0152cf0306574/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp#L753-L819) is duplicated at least 5 times (and will grow).
2. Lack of separation - a lot of not related code like parsing is here, this can be grouped logically.
How it works:
1. This template class provide two generic functions which will be reused (processStoreOperations, processStoreOperationsSync) - this solves problem 1.
2. Has two pure virtual method which need to be overriden (parseDBDataStore, createOperations), those methods are specialized for each data type (Messages, Threads, etc.) - this solves problem 2.
Why `.h` file?
When a template is used in C++, the compiler needs to have access to the entire template definition (not just a declaration) because it needs to generate the code for the specific instantiation at the compile-time. ([source](https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl)).
Why not static methods when class does not have state?
I wanted to make sure that each child class (which will inherit from `BaseDataStore`) will override methods for parsing and creating ops. This can not be achieved in an easy way with static methods - but I am open to modify if someone has valid suggestions.
For more details check next diff in the stack.
Depends on D8601