diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2018-10-05 13:44:20 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-10-24 19:20:02 +0300 |
commit | 8ab3a1f5bf39bb6fa148ecf605d11583b37c82b5 (patch) | |
tree | 4ae7144fba533fad2ec0ec5c87dfa20ecbd75d7e /local_ads | |
parent | 67185059a3813c91b63503bfd5c1e9c20b92b63e (diff) |
Local ads features processing for geofencing.
Diffstat (limited to 'local_ads')
-rw-r--r-- | local_ads/event.hpp | 3 | ||||
-rw-r--r-- | local_ads/statistics.cpp | 8 | ||||
-rw-r--r-- | local_ads/statistics.hpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/local_ads/event.hpp b/local_ads/event.hpp index f45c7bb9a3..ef5c17bf06 100644 --- a/local_ads/event.hpp +++ b/local_ads/event.hpp @@ -13,7 +13,8 @@ enum class EventType ShowPoint = 0, OpenInfo, ClickedPhone, - ClickedWebsite + ClickedWebsite, + Visit }; struct Event diff --git a/local_ads/statistics.cpp b/local_ads/statistics.cpp index d9face059d..2d65a3eefd 100644 --- a/local_ads/statistics.cpp +++ b/local_ads/statistics.cpp @@ -130,7 +130,7 @@ local_ads::Timestamp GetMaxTimestamp(std::list<local_ads::Event> const & events, std::string GetPath(std::string const & fileName) { - return base::JoinFoldersToPath({GetPlatform().WritableDir(), kStatisticsFolderName}, fileName); + return base::JoinFoldersToPath({GetPlatform().SettingsDir(), kStatisticsFolderName}, fileName); } std::string GetPath(local_ads::Event const & event) @@ -270,6 +270,12 @@ void Statistics::RegisterEvents(std::list<Event> && events) std::bind(&Statistics::ProcessEvents, this, std::move(events))); } +void Statistics::RegisterEventSync(Event && event) +{ + std::list<Event> events = {std::move(event)}; + ProcessEvents(events); +} + void Statistics::SetEnabled(bool isEnabled) { m_isEnabled = isEnabled; diff --git a/local_ads/statistics.hpp b/local_ads/statistics.hpp index 2fc8dcc9c4..e71ac771e9 100644 --- a/local_ads/statistics.hpp +++ b/local_ads/statistics.hpp @@ -37,6 +37,8 @@ public: void Startup(); void RegisterEvent(Event && event); void RegisterEvents(std::list<Event> && events); + // Save the event synchronously (for lightweight frawework only). + void RegisterEventSync(Event && event); void SetEnabled(bool isEnabled); std::list<Event> WriteEventsForTesting(std::list<Event> const & events, |