blob: d4e8c3af7a6ada786c9e67ac5bcdf28542ce4bac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#pragma once
#include "base/worker_thread.hpp"
#include "ugc/storage.hpp"
#include "ugc/types.hpp"
#include <functional>
class Index;
struct FeatureID;
namespace ugc
{
class Api
{
public:
using UGCCallback = std::function<void(UGC const & ugc, UGCUpdate const & update)>;
explicit Api(Index const & index, std::string const & filename);
void GetUGC(FeatureID const & id, UGCCallback callback);
void SetUGCUpdate(FeatureID const & id, UGCUpdate const & ugc);
static UGC MakeTestUGC1(Time now = Clock::now());
static UGC MakeTestUGC2(Time now = Clock::now());
static UGCUpdate MakeTestUGCUpdate(Time now = Clock::now());
private:
void GetUGCImpl(FeatureID const & id, UGCCallback callback);
void SetUGCUpdateImpl(FeatureID const & id, UGCUpdate const & ugc);
Index const & m_index;
base::WorkerThread m_thread;
Storage m_storage;
};
} // namespace ugc
|