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

connection.hpp « tracking - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 84134464df12c4085593bdf4506cf56371329953 (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
40
41
42
43
44
#pragma once

#include "coding/traffic.hpp"

#include "std/cstdint.hpp"
#include "std/string.hpp"
#include "std/unique_ptr.hpp"
#include "std/vector.hpp"

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-local-typedef"
#endif

#include "boost/circular_buffer.hpp"

#if defined(__clang__)
#pragma clang diagnostic pop
#endif

namespace platform
{
class Socket;
}

namespace tracking
{
using DataPoint = coding::TrafficGPSEncoder::DataPoint;

class Connection final
{
public:
  Connection(unique_ptr<platform::Socket> socket, string const & host, uint16_t port,
             bool isHistorical);
  bool Reconnect();
  void Shutdown();
  bool Send(boost::circular_buffer<DataPoint> const & points);

private:
  unique_ptr<platform::Socket> m_socket;
  string const m_host;
  uint16_t const m_port;
};
}  // namespace tracking