-
Notifications
You must be signed in to change notification settings - Fork 606
/
simple_types.cpp
130 lines (112 loc) · 3.86 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
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
127
128
129
130
/**
* Autogenerated by Thrift for src/simple.thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#include "thrift/compiler/test/fixtures/lazy_deserialization/gen-cpp2/simple_types.h"
#include "thrift/compiler/test/fixtures/lazy_deserialization/gen-cpp2/simple_types.tcc"
#include <thrift/lib/cpp2/gen/module_types_cpp.h>
#include "thrift/compiler/test/fixtures/lazy_deserialization/gen-cpp2/simple_data.h"
namespace apache {
namespace thrift {
namespace detail {
void TccStructTraits<::apache::thrift::test::Foo>::translateFieldName(
folly::StringPiece _fname,
int16_t& fid,
apache::thrift::protocol::TType& _ftype) noexcept {
using data = apache::thrift::TStructDataStorage<::apache::thrift::test::Foo>;
static const st::translate_field_name_table table{
data::fields_size,
data::fields_names.data(),
data::fields_ids.data(),
data::fields_types.data()};
st::translate_field_name(_fname, fid, _ftype, table);
}
} // namespace detail
} // namespace thrift
} // namespace apache
namespace apache { namespace thrift { namespace test {
THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
Foo::Foo(apache::thrift::FragileConstructor, ::std::string field1__arg, ::std::string field2__arg, ::std::vector<int32_t> field3__arg, ::std::vector<int32_t> field4__arg) :
field1(std::move(field1__arg)),
field2(std::move(field2__arg)),
field3(std::move(field3__arg)),
field4(std::move(field4__arg)) {
__isset.field1 = true;
__isset.field2 = true;
__isset.field3 = true;
__isset.field4 = true;
}
THRIFT_IGNORE_ISSET_USE_WARNING_END
void Foo::__clear() {
// clear all fields
field1 = apache::thrift::StringTraits< std::string>::fromStringLiteral("");
field2 = apache::thrift::StringTraits< std::string>::fromStringLiteral("");
field3.clear();
field4.clear();
THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
__isset = {};
THRIFT_IGNORE_ISSET_USE_WARNING_END
}
bool Foo::operator==(const Foo& rhs) const {
(void)rhs;
auto& lhs = *this;
(void)lhs;
if (!(lhs.field1 == rhs.field1)) {
return false;
}
if (!(lhs.field2 == rhs.field2)) {
return false;
}
if (!(lhs.field3 == rhs.field3)) {
return false;
}
if (!(lhs.field4 == rhs.field4)) {
return false;
}
return true;
}
bool Foo::operator<(const Foo& rhs) const {
(void)rhs;
auto& lhs = *this;
(void)lhs;
if (!(lhs.field1 == rhs.field1)) {
return lhs.field1 < rhs.field1;
}
if (!(lhs.field2 == rhs.field2)) {
return lhs.field2 < rhs.field2;
}
if (!(lhs.field3 == rhs.field3)) {
return lhs.field3 < rhs.field3;
}
if (!(lhs.field4 == rhs.field4)) {
return lhs.field4 < rhs.field4;
}
return false;
}
const ::std::vector<int32_t>& Foo::get_field4() const& {
return field4;
}
::std::vector<int32_t> Foo::get_field4() && {
return std::move(field4);
}
void swap(Foo& a, Foo& b) {
using ::std::swap;
swap(a.field1_ref().value(), b.field1_ref().value());
swap(a.field2_ref().value(), b.field2_ref().value());
swap(a.field3_ref().value(), b.field3_ref().value());
swap(a.field4_ref().value(), b.field4_ref().value());
THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN
swap(a.__isset, b.__isset);
THRIFT_IGNORE_ISSET_USE_WARNING_END
}
template void Foo::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t Foo::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t Foo::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t Foo::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void Foo::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t Foo::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t Foo::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t Foo::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
}}} // apache::thrift::test