-
Notifications
You must be signed in to change notification settings - Fork 0
/
interaction.h
62 lines (49 loc) · 1.2 KB
/
interaction.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
#ifndef INTERACTION_H
#define INTERACTION_H
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
struct Interaction
{
Interaction();
Interaction( std::istringstream &ss);
Interaction(char *start, char *end);
~Interaction();
Interaction& operator=(const Interaction &rhs);
bool operator==(const Interaction &rhs) const;
void init(char *start, char *end);
inline size_t str2num(char *start, char *end){
char *ptr = start;
size_t value = 0;
while(ptr != end){
value = value*10 +(*ptr++ - '0');
}
return value;
}
inline size_t str2num(const char *start, int length){
size_t value = 0;
int nCnt = 0;
while(nCnt < length){
value = value*10 + (start[nCnt] - '0');
++nCnt;
}
return value;
}
//data member
short click;
short impression;
// string displayURL;
size_t displayURL_H;
size_t displayURL_L;
size_t adID;
size_t advertiserID;
short depth;
short position;
size_t queryID;
size_t keywordID;
size_t titleID;
size_t descriptionID;
size_t userID;
};
#endif // INTERACTION_H