-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple_types.cpp
88 lines (76 loc) · 2.38 KB
/
simple_types.cpp
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
87
88
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
#include "simple_types.h"
namespace simple {
const char* Work::ascii_fingerprint = "DE035C7565A0274CBA4FB0CDABB89798";
const uint8_t Work::binary_fingerprint[16] = {0xDE,0x03,0x5C,0x75,0x65,0xA0,0x27,0x4C,0xBA,0x4F,0xB0,0xCD,0xAB,0xB8,0x97,0x98};
uint32_t Work::read(facebook::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
facebook::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using facebook::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == facebook::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == facebook::thrift::protocol::T_I32) {
xfer += iprot->readI32(this->cpuid);
this->__isset.cpuid = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == facebook::thrift::protocol::T_I32) {
int32_t ecast0;
xfer += iprot->readI32(ecast0);
this->type = (MemOp)ecast0;
this->__isset.type = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 3:
if (ftype == facebook::thrift::protocol::T_I32) {
xfer += iprot->readI32(this->addr);
this->__isset.addr = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
return xfer;
}
uint32_t Work::write(facebook::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
xfer += oprot->writeStructBegin("Work");
xfer += oprot->writeFieldBegin("cpuid", facebook::thrift::protocol::T_I32, 1);
xfer += oprot->writeI32(this->cpuid);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("type", facebook::thrift::protocol::T_I32, 2);
xfer += oprot->writeI32((int32_t)this->type);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("addr", facebook::thrift::protocol::T_I32, 3);
xfer += oprot->writeI32(this->addr);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
} // namespace