1 /**
2  * Autogenerated by Thrift for src/include2.thrift
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated @nocommit
6  */
7 #include "thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include2_types.h"
8 #include "thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include2_types.tcc"
9 
10 #include <thrift/lib/cpp2/gen/module_types_cpp.h>
11 
12 #include "thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include2_data.h"
13 
14 
15 namespace apache {
16 namespace thrift {
17 namespace detail {
18 
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)19 void TccStructTraits<::some::ns::IncludedB>::translateFieldName(
20     folly::StringPiece _fname,
21     int16_t& fid,
22     apache::thrift::protocol::TType& _ftype) noexcept {
23   using data = apache::thrift::TStructDataStorage<::some::ns::IncludedB>;
24   static const st::translate_field_name_table table{
25       data::fields_size,
26       data::fields_names.data(),
27       data::fields_ids.data(),
28       data::fields_types.data()};
29   st::translate_field_name(_fname, fid, _ftype, table);
30 }
31 
32 } // namespace detail
33 } // namespace thrift
34 } // namespace apache
35 
36 namespace some { namespace ns {
37 
38 IncludedB::IncludedB(const IncludedB&) = default;
39 IncludedB& IncludedB::operator=(const IncludedB&) = default;
IncludedB(IncludedB && other)40 IncludedB::IncludedB(IncludedB&& other) noexcept  :
41     __fbthrift_field_i32Field(std::move(other.__fbthrift_field_i32Field)),
42     __fbthrift_field_strField(std::move(other.__fbthrift_field_strField)),
43     __isset(other.__isset) {
44 }
45 
operator =(FOLLY_MAYBE_UNUSED IncludedB && other)46 IncludedB& IncludedB::operator=(FOLLY_MAYBE_UNUSED IncludedB&& other) noexcept {
47     this->__fbthrift_field_i32Field = std::move(other.__fbthrift_field_i32Field);
48     this->__fbthrift_field_strField = std::move(other.__fbthrift_field_strField);
49     __isset = other.__isset;
50     return *this;
51 }
52 
53 
IncludedB(apache::thrift::FragileConstructor,::std::int32_t i32Field__arg,::std::string strField__arg)54 IncludedB::IncludedB(apache::thrift::FragileConstructor, ::std::int32_t i32Field__arg, ::std::string strField__arg) :
55     __fbthrift_field_i32Field(std::move(i32Field__arg)),
56     __fbthrift_field_strField(std::move(strField__arg)) {
57   __isset.set(folly::index_constant<0>(), true);
58   __isset.set(folly::index_constant<1>(), true);
59 }
60 
61 
__fbthrift_clear()62 void IncludedB::__fbthrift_clear() {
63   // clear all fields
64   this->__fbthrift_field_i32Field = ::std::int32_t();
65   this->__fbthrift_field_strField = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
66   __isset = {};
67 }
68 
operator ==(const IncludedB & rhs) const69 bool IncludedB::operator==(const IncludedB& rhs) const {
70   (void)rhs;
71   auto& lhs = *this;
72   (void)lhs;
73   if (!(lhs.i32Field_ref() == rhs.i32Field_ref())) {
74     return false;
75   }
76   if (!(lhs.strField_ref() == rhs.strField_ref())) {
77     return false;
78   }
79   return true;
80 }
81 
operator <(const IncludedB & rhs) const82 bool IncludedB::operator<(const IncludedB& rhs) const {
83   (void)rhs;
84   auto& lhs = *this;
85   (void)lhs;
86   if (!(lhs.i32Field_ref() == rhs.i32Field_ref())) {
87     return lhs.i32Field_ref() < rhs.i32Field_ref();
88   }
89   if (!(lhs.strField_ref() == rhs.strField_ref())) {
90     return lhs.strField_ref() < rhs.strField_ref();
91   }
92   return false;
93 }
94 
95 
swap(IncludedB & a,IncludedB & b)96 void swap(IncludedB& a, IncludedB& b) {
97   using ::std::swap;
98   swap(a.i32Field_ref().value(), b.i32Field_ref().value());
99   swap(a.strField_ref().value(), b.strField_ref().value());
100   swap(a.__isset, b.__isset);
101 }
102 
103 template void IncludedB::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
104 template uint32_t IncludedB::write<>(apache::thrift::BinaryProtocolWriter*) const;
105 template uint32_t IncludedB::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
106 template uint32_t IncludedB::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
107 template void IncludedB::readNoXfer<>(apache::thrift::CompactProtocolReader*);
108 template uint32_t IncludedB::write<>(apache::thrift::CompactProtocolWriter*) const;
109 template uint32_t IncludedB::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
110 template uint32_t IncludedB::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
111 
112 
113 
114 }} // some::ns
115 
116 namespace some { namespace ns { namespace {
validateAdapters()117 FOLLY_MAYBE_UNUSED FOLLY_ERASE void validateAdapters() {
118 }
119 }}} // some::ns
120