-
Notifications
You must be signed in to change notification settings - Fork 0
/
nyan_types.cpp
126 lines (102 loc) · 3.08 KB
/
nyan_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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/**
* Autogenerated by Thrift Compiler (1.0.0-dev)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "nyan_types.h"
#include <algorithm>
#include <ostream>
#include <thrift/TToString.h>
namespace nyan {
SyncPacket::~SyncPacket() throw() {
}
void SyncPacket::__set_server(const int32_t val) {
this->server = val;
}
void SyncPacket::__set_frame(const int32_t val) {
this->frame = val;
}
const char* SyncPacket::ascii_fingerprint = "989D1F1AE8D148D5E2119FFEC4BBBEE3";
const uint8_t SyncPacket::binary_fingerprint[16] = {0x98,0x9D,0x1F,0x1A,0xE8,0xD1,0x48,0xD5,0xE2,0x11,0x9F,0xFE,0xC4,0xBB,0xBE,0xE3};
uint32_t SyncPacket::read(::apache::thrift::protocol::TProtocol* iprot) {
apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
uint32_t xfer = 0;
std::string fname;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using ::apache::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == ::apache::thrift::protocol::T_I32) {
xfer += iprot->readI32(this->server);
this->__isset.server = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 2:
if (ftype == ::apache::thrift::protocol::T_I32) {
xfer += iprot->readI32(this->frame);
this->__isset.frame = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
return xfer;
}
uint32_t SyncPacket::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
xfer += oprot->writeStructBegin("SyncPacket");
xfer += oprot->writeFieldBegin("server", ::apache::thrift::protocol::T_I32, 1);
xfer += oprot->writeI32(this->server);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("frame", ::apache::thrift::protocol::T_I32, 2);
xfer += oprot->writeI32(this->frame);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
void swap(SyncPacket &a, SyncPacket &b) {
using ::std::swap;
swap(a.server, b.server);
swap(a.frame, b.frame);
swap(a.__isset, b.__isset);
}
SyncPacket::SyncPacket(const SyncPacket& other0) {
server = other0.server;
frame = other0.frame;
__isset = other0.__isset;
}
SyncPacket& SyncPacket::operator=(const SyncPacket& other1) {
server = other1.server;
frame = other1.frame;
__isset = other1.__isset;
return *this;
}
std::ostream& operator<<(std::ostream& out, const SyncPacket& obj) {
using apache::thrift::to_string;
out << "SyncPacket(";
out << "server=" << to_string(obj.server);
out << ", " << "frame=" << to_string(obj.frame);
out << ")";
return out;
}
} // namespace