blob: 48445444bd8d1c4ba87a3fc849f5ac7b7c506c47 (
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 "coding/traffic.hpp"
#include "std/cstdint.hpp"
#include "std/string.hpp"
#include "std/unique_ptr.hpp"
#include "std/vector.hpp"
#include "boost/circular_buffer.hpp"
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();
bool Send(boost::circular_buffer<DataPoint> const & points);
private:
unique_ptr<platform::Socket> m_socket;
string const m_host;
uint16_t const m_port;
bool const m_isHistorical;
};
} // namespace tracking
|