-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreventisclient_util.hpp
71 lines (37 loc) · 2.07 KB
/
reventisclient_util.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _CLIENT_UTIL_H
#define _CLIENT_UTIL_H
#include <cstdlib>
#include <string>
#include <stdexcept>
#include "hiredis.h"
using namespace std;
/* read events from file and submit to redis-server under key */
int LoadEvents(redisContext *c, const string &key, const string &file);
long long AddEvent(redisContext *c, const string &key, const double x, const double y,
const string &startdatetime, const string &enddatetime, const string &descr);
void AddCategory(redisContext *c, const string &key, const long long id, int n, ...);
void RemoveCategory(redisContext *c, const string &key, const long long id, int n, ...);
/* read objects from file and submit to redis-server */
int LoadObjects(redisContext *c, const string &key, const string &file);
int GetSize(redisContext *c, const string &key);
void DeleteKey(redisContext *c, const string &key);
int Query(redisContext *c, const string &key, const double x1, const double x2,
const double y1, const double y2, const string &startdatetime,
const string &enddatetime, int n, ...);
int QueryByRadius(redisContext *c, const string &key,
const double x, const double y, const double radius,
const string &startdatetime, const string &enddatetime, int n, ...);
int ObjectHistory(redisContext *c, const string &key, const long long object_id);
int ObjectHistory2(redisContext *c, const string &key, const long long object_id,
const string &t1, const string &td2);
int TrackAll(redisContext *c, const string &key,
const double x1, const double x2,
const double y1, const double y2,
const string &startdatetime, const string &enddatetime);
int PurgeAllBefore(redisContext *c, const string &key, const string &datetime);
int DeleteBlock(redisContext *c, const string &key,
const double x1, const double x2, const double y1, const double y2,
const string &startdatetime, const string &enddatetime);
int DeleteObject(redisContext *c, const string &key, const long long object_id);
void DeleteEvent(redisContext *c, const string &key, const long long event_id);
#endif /* _CLIENT_UTIL_H */