Welcome to mirror list, hosted at ThFree Co, Russian Federation.

api.hpp « ugc - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a9b50777b2a1b41af4a5e78fc55d48427cde4dde (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
#pragma once

#include "base/worker_thread.hpp"

#include "ugc/loader.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);

private:
  void GetUGCImpl(FeatureID const & id, UGCCallback callback);

  void SetUGCUpdateImpl(FeatureID const & id, UGCUpdate const & ugc);

  base::WorkerThread m_thread;
  Storage m_storage;
  Loader m_loader;
};
}  // namespace ugc