-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrajUpdateAlgebra.h
87 lines (70 loc) · 2.58 KB
/
TrajUpdateAlgebra.h
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef _TRAJUPDATEALGEBRA_H
#define _TRAJUPDATEALGEBRA_H
#include "NestedList.h"
#include "ListUtils.h"
#include <map>
#include <list>
#include <string>
/*
//
//
class TrajUpdate
{
public:
// create a new Trajectory Update
// give the two tuple type information of current position relation and trajectories relation;
//
TrajUpdate(const ListExpr typeInfo_current_pos, const ListExpr typeInfo_trajectories);
TrajUpdate(TupleType *typeInfo_current_pos, TupleType *typeInfo_trajectories);
// open a Trajectory Update
TrajUpdate(SmiFileId fileid_btree, SmiFileId fileid_rtree,
RelationDescriptor &relDesc_current_pos, RelationDescriptor &relDesc_trajectories);
// destructor a Trajectory Update
~TrajUpdate();
// The mandatory set of algebra support function
//
static Word In(const ListExpr typeinfo, const ListExpr instance,
const int errorPos, ListExpr &errorInfo, bool & correct);
static ListExpr Out(ListExpr typeInfo, Word value);
static Word Create(const ListExpr typeinfo);
static void Delete(const ListExpr typeinfo, Word &w);
static bool Open(SmiRecord &valueRecord, size_t &offset,
const ListExpr typeinfo, Word &value);
static bool Save(SmiRecord &valueRecord, size_t &offset,
const ListExpr typeinfo, Word &w);
static void Close(const ListExpr typeinfo, Word &w);
static Word Clone(const ListExpr typeinfo, const Word &w);
static bool KindCheck(ListExpr type, ListExpr &errorInfo);
static void* Cast(void *addr);
static int SizeOfObj();
static ListExpr Property();
//
inline static const string BasicType() { return "trajupdate"; }
//
static const bool checkType(const ListExpr type) {
return listutils::isSymbol(type, BasicType());
}
private:
//SmiRecordFile* rtreefile;
//SmiFileId fid;
//file identifier of btree
SmiFileId fidofbtree;
//file identifier of rtree
SmiFileId fidofrtree;
// btree to index the identifier of objects
BTree btree;
// 3d rtree to index the trjecotries using MBR of trajectory
R_Tree rtree;
//Relation of current position (Id(int), Pos_x(double), Pos_y(double), Timestamp(double))
Relation current_pos;
//Relation of trajectories (Id(int), Traj(mpoint))
Relation trajectories;
//
// restore the descriptor of relation
RelationDescriptor relDesc_current_pos;
RelationDescriptor relDesc_trajectories;
//size_t size;
//size_t pagesize;
};
*/
#endif