snowplow / snowplow-cpp-tracker

Snowplow event tracker for C++. Add analytics to your C++ applications, games and servers
http://snowplowanalytics.com
Apache License 2.0
9 stars 6 forks source link

Expose an interface for storage and make it configurable (close #48) #67

Closed matus-tomlein closed 2 years ago

matus-tomlein commented 2 years ago

This PR addresses issue #48 and refactors the Storage class to drop the singleton and extract interfaces for event and session store.

I decided to extract two interfaces (C++ structs) for EventStore and SessionStore since some users could have a different storage for the event queue and for sessions. Previously, there was a requirement to use the same storage for events and sessions but this was only due to the use of Singleton. We can drop the requirement now as there are no dependencies between the storage of events and sessions.

The initialization of the Emitter and ClientSession classes has changed as they no longer accept a string with the path to an SQLite database but a storage instance.

I kept the same methods as used before in the Storage class but renamed them to reflect the Java tracker EventStore.

Documentation

There are changes in various parts of the documentation. I created a PR in data-value-resources here.