This PR removes Store class definitions from the generated code and moves all the Store opening and loading logic into the Database.
Rather than just maintaining a weak_ptr for each store type, the Database keeps a single strong shared_ptr for the most recently opened store. This gets disposed using the task queue so doesn't hang around long, but accommodates the most likely scenario where multiple database accessess occur in succession.
The json schema annotation is now just used as a marker and can be set to anything (typically just true). Applications can create their own Database implementation and customise by overriding the createStore method.
This also allows some simplification to the generator script.
This PR removes
Store
class definitions from the generated code and moves all the Store opening and loading logic into the Database.Rather than just maintaining a weak_ptr for each store type, the
Database
keeps a single strongshared_ptr
for the most recently opened store. This gets disposed using the task queue so doesn't hang around long, but accommodates the most likely scenario where multiple database accessess occur in succession.The json schema annotation is now just used as a marker and can be set to anything (typically just true). Applications can create their own Database implementation and customise by overriding the
createStore
method.This also allows some simplification to the generator script.