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: 4f578ce53e11e7b9970485aa1f227594032ebb12 (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
#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);

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