1 /**
2  * Autogenerated by Thrift for src/module.thrift
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated @nocommit
6  */
7 #pragma once
8 
9 #include <thrift/lib/cpp2/gen/module_types_h.h>
10 
11 
12 
13 namespace apache {
14 namespace thrift {
15 namespace tag {
16 struct MyIntField;
17 struct MyStringField;
18 } // namespace tag
19 namespace detail {
20 #ifndef APACHE_THRIFT_ACCESSOR_MyIntField
21 #define APACHE_THRIFT_ACCESSOR_MyIntField
22 APACHE_THRIFT_DEFINE_ACCESSOR(MyIntField);
23 #endif
24 #ifndef APACHE_THRIFT_ACCESSOR_MyStringField
25 #define APACHE_THRIFT_ACCESSOR_MyStringField
26 APACHE_THRIFT_DEFINE_ACCESSOR(MyStringField);
27 #endif
28 } // namespace detail
29 } // namespace thrift
30 } // namespace apache
31 
32 // BEGIN declare_enums
33 namespace cpp2 {
34 
35 enum class MyEnum {
36   MyValue1 = 0,
37   MyValue2 = 1,
38 };
39 
40 
41 
42 
43 } // cpp2
44 
45 namespace std {
46 template<> struct hash<::cpp2::MyEnum> :
47   ::apache::thrift::detail::enum_hash<::cpp2::MyEnum> {};
48 } // std
49 
50 namespace apache { namespace thrift {
51 
52 
53 template <> struct TEnumDataStorage<::cpp2::MyEnum>;
54 
55 template <> struct TEnumTraits<::cpp2::MyEnum> {
56   using type = ::cpp2::MyEnum;
57 
58   static constexpr std::size_t const size = 2;
59   static folly::Range<type const*> const values;
60   static folly::Range<folly::StringPiece const*> const names;
61 
62   static char const* findName(type value);
63   static bool findValue(char const* name, type* out);
64 
65   static constexpr type min() { return type::MyValue1; }
66   static constexpr type max() { return type::MyValue2; }
67 };
68 
69 
70 }} // apache::thrift
71 
72 namespace cpp2 {
73 
74 using _MyEnum_EnumMapFactory = apache::thrift::detail::TEnumMapFactory<MyEnum>;
75 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
76 extern const _MyEnum_EnumMapFactory::ValuesToNamesMapType _MyEnum_VALUES_TO_NAMES;
77 [[deprecated("use apache::thrift::TEnumTraits")]]
78 extern const _MyEnum_EnumMapFactory::NamesToValuesMapType _MyEnum_NAMES_TO_VALUES;
79 
80 } // cpp2
81 
82 // END declare_enums
83 // BEGIN forward_declare
84 namespace cpp2 {
85 class MyStruct;
86 } // cpp2
87 // END forward_declare
88 // BEGIN typedefs
89 
90 // END typedefs
91 // BEGIN hash_and_equal_to
92 // END hash_and_equal_to
93 namespace cpp2 {
94 using ::apache::thrift::detail::operator!=;
95 using ::apache::thrift::detail::operator>;
96 using ::apache::thrift::detail::operator<=;
97 using ::apache::thrift::detail::operator>=;
98 } // cpp2
99 namespace cpp2 {
100 class MyStruct final  {
101  private:
102   friend struct ::apache::thrift::detail::st::struct_private_access;
103 
104   //  used by a static_assert in the corresponding source
105   static constexpr bool __fbthrift_cpp2_gen_json = false;
106   static constexpr bool __fbthrift_cpp2_gen_nimble = false;
107   static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false;
108 
109   void __fbthrift_clear();
110 
111  public:
112   using __fbthrift_cpp2_type = MyStruct;
113   static constexpr bool __fbthrift_cpp2_is_union =
114     false;
115 
116 
117  public:
118 
119   MyStruct() :
120       __fbthrift_field_MyIntField() {
121   }
122   // FragileConstructor for use in initialization lists only.
123   [[deprecated("This constructor is deprecated")]]
124   MyStruct(apache::thrift::FragileConstructor, ::std::int64_t MyIntField__arg, ::std::string MyStringField__arg);
125 
126   MyStruct(MyStruct&&) noexcept;
127 
128   MyStruct(const MyStruct& src);
129 
130 
131   MyStruct& operator=(MyStruct&&) noexcept;
132   MyStruct& operator=(const MyStruct& src);
133  private:
134   ::std::int64_t __fbthrift_field_MyIntField;
135  private:
136   ::std::string __fbthrift_field_MyStringField;
137  private:
138   apache::thrift::detail::isset_bitset<2, false> __isset;
139 
140  public:
141 
142   bool operator==(const MyStruct&) const;
143   bool operator<(const MyStruct&) const;
144 
145   template <typename..., typename T = ::std::int64_t>
146   FOLLY_ERASE ::apache::thrift::field_ref<const T&> MyIntField_ref() const& {
147     return {this->__fbthrift_field_MyIntField, __isset.at(0), __isset.bit(0)};
148   }
149 
150   template <typename..., typename T = ::std::int64_t>
151   FOLLY_ERASE ::apache::thrift::field_ref<const T&&> MyIntField_ref() const&& {
152     return {static_cast<const T&&>(this->__fbthrift_field_MyIntField), __isset.at(0), __isset.bit(0)};
153   }
154 
155   template <typename..., typename T = ::std::int64_t>
156   FOLLY_ERASE ::apache::thrift::field_ref<T&> MyIntField_ref() & {
157     return {this->__fbthrift_field_MyIntField, __isset.at(0), __isset.bit(0)};
158   }
159 
160   template <typename..., typename T = ::std::int64_t>
161   FOLLY_ERASE ::apache::thrift::field_ref<T&&> MyIntField_ref() && {
162     return {static_cast<T&&>(this->__fbthrift_field_MyIntField), __isset.at(0), __isset.bit(0)};
163   }
164 
165   template <typename..., typename T = ::std::int64_t>
166   FOLLY_ERASE ::apache::thrift::field_ref<const T&> MyIntField() const& {
167     return {this->__fbthrift_field_MyIntField, __isset.at(0), __isset.bit(0)};
168   }
169 
170   template <typename..., typename T = ::std::int64_t>
171   FOLLY_ERASE ::apache::thrift::field_ref<const T&&> MyIntField() const&& {
172     return {static_cast<const T&&>(this->__fbthrift_field_MyIntField), __isset.at(0), __isset.bit(0)};
173   }
174 
175   template <typename..., typename T = ::std::int64_t>
176   FOLLY_ERASE ::apache::thrift::field_ref<T&> MyIntField() & {
177     return {this->__fbthrift_field_MyIntField, __isset.at(0), __isset.bit(0)};
178   }
179 
180   template <typename..., typename T = ::std::int64_t>
181   FOLLY_ERASE ::apache::thrift::field_ref<T&&> MyIntField() && {
182     return {static_cast<T&&>(this->__fbthrift_field_MyIntField), __isset.at(0), __isset.bit(0)};
183   }
184 
185   template <typename..., typename T = ::std::string>
186   FOLLY_ERASE ::apache::thrift::field_ref<const T&> MyStringField_ref() const& {
187     return {this->__fbthrift_field_MyStringField, __isset.at(1), __isset.bit(1)};
188   }
189 
190   template <typename..., typename T = ::std::string>
191   FOLLY_ERASE ::apache::thrift::field_ref<const T&&> MyStringField_ref() const&& {
192     return {static_cast<const T&&>(this->__fbthrift_field_MyStringField), __isset.at(1), __isset.bit(1)};
193   }
194 
195   template <typename..., typename T = ::std::string>
196   FOLLY_ERASE ::apache::thrift::field_ref<T&> MyStringField_ref() & {
197     return {this->__fbthrift_field_MyStringField, __isset.at(1), __isset.bit(1)};
198   }
199 
200   template <typename..., typename T = ::std::string>
201   FOLLY_ERASE ::apache::thrift::field_ref<T&&> MyStringField_ref() && {
202     return {static_cast<T&&>(this->__fbthrift_field_MyStringField), __isset.at(1), __isset.bit(1)};
203   }
204 
205   template <typename..., typename T = ::std::string>
206   FOLLY_ERASE ::apache::thrift::field_ref<const T&> MyStringField() const& {
207     return {this->__fbthrift_field_MyStringField, __isset.at(1), __isset.bit(1)};
208   }
209 
210   template <typename..., typename T = ::std::string>
211   FOLLY_ERASE ::apache::thrift::field_ref<const T&&> MyStringField() const&& {
212     return {static_cast<const T&&>(this->__fbthrift_field_MyStringField), __isset.at(1), __isset.bit(1)};
213   }
214 
215   template <typename..., typename T = ::std::string>
216   FOLLY_ERASE ::apache::thrift::field_ref<T&> MyStringField() & {
217     return {this->__fbthrift_field_MyStringField, __isset.at(1), __isset.bit(1)};
218   }
219 
220   template <typename..., typename T = ::std::string>
221   FOLLY_ERASE ::apache::thrift::field_ref<T&&> MyStringField() && {
222     return {static_cast<T&&>(this->__fbthrift_field_MyStringField), __isset.at(1), __isset.bit(1)};
223   }
224 
225   ::std::int64_t get_MyIntField() const {
226     return __fbthrift_field_MyIntField;
227   }
228 
229   [[deprecated("Use `FOO.MyIntField_ref() = BAR;` instead of `FOO.set_MyIntField(BAR);`")]]
230   ::std::int64_t& set_MyIntField(::std::int64_t MyIntField_) {
231     MyIntField_ref() = MyIntField_;
232     return __fbthrift_field_MyIntField;
233   }
234 
235   const ::std::string& get_MyStringField() const& {
236     return __fbthrift_field_MyStringField;
237   }
238 
239   ::std::string get_MyStringField() && {
240     return std::move(__fbthrift_field_MyStringField);
241   }
242 
243   template <typename T_MyStruct_MyStringField_struct_setter = ::std::string>
244   [[deprecated("Use `FOO.MyStringField_ref() = BAR;` instead of `FOO.set_MyStringField(BAR);`")]]
245   ::std::string& set_MyStringField(T_MyStruct_MyStringField_struct_setter&& MyStringField_) {
246     MyStringField_ref() = std::forward<T_MyStruct_MyStringField_struct_setter>(MyStringField_);
247     return __fbthrift_field_MyStringField;
248   }
249 
250   template <class Protocol_>
251   uint32_t read(Protocol_* iprot);
252   template <class Protocol_>
253   uint32_t serializedSize(Protocol_ const* prot_) const;
254   template <class Protocol_>
255   uint32_t serializedSizeZC(Protocol_ const* prot_) const;
256   template <class Protocol_>
257   uint32_t write(Protocol_* prot_) const;
258 
259  private:
260   template <class Protocol_>
261   void readNoXfer(Protocol_* iprot);
262 
263   friend class ::apache::thrift::Cpp2Ops<MyStruct>;
264   friend void swap(MyStruct& a, MyStruct& b);
265 };
266 
267 template <class Protocol_>
268 uint32_t MyStruct::read(Protocol_* iprot) {
269   auto _xferStart = iprot->getCursorPosition();
270   readNoXfer(iprot);
271   return iprot->getCursorPosition() - _xferStart;
272 }
273 
274 } // cpp2
275