2 * Autogenerated by Thrift for src/enums.thrift
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
9 #include <thrift/lib/cpp2/gen/module_types_h.h>
11 #include <thrift/lib/cpp2/type/Tag.h>
20 #ifndef APACHE_THRIFT_ACCESSOR_fieldA
21 #define APACHE_THRIFT_ACCESSOR_fieldA
22 APACHE_THRIFT_DEFINE_ACCESSOR(fieldA
);
28 // BEGIN declare_enums
29 namespace facebook
{ namespace ns
{ namespace qwerty
{
62 }}} // facebook::ns::qwerty
65 template<> struct hash
<::facebook::ns::qwerty::AnEnumA
> :
66 ::apache::thrift::detail::enum_hash
<::facebook::ns::qwerty::AnEnumA
> {};
67 template<> struct hash
<::facebook::ns::qwerty::AnEnumB
> :
68 ::apache::thrift::detail::enum_hash
<::facebook::ns::qwerty::AnEnumB
> {};
69 template<> struct hash
<::facebook::ns::qwerty::AnEnumC
> :
70 ::apache::thrift::detail::enum_hash
<::facebook::ns::qwerty::AnEnumC
> {};
71 template<> struct hash
<::facebook::ns::qwerty::AnEnumD
> :
72 ::apache::thrift::detail::enum_hash
<::facebook::ns::qwerty::AnEnumD
> {};
73 template<> struct hash
<::facebook::ns::qwerty::AnEnumE
> :
74 ::apache::thrift::detail::enum_hash
<::facebook::ns::qwerty::AnEnumE
> {};
77 namespace apache
{ namespace thrift
{
80 template <> struct TEnumDataStorage
<::facebook::ns::qwerty::AnEnumA
>;
82 template <> struct TEnumTraits
<::facebook::ns::qwerty::AnEnumA
> {
83 using type
= ::facebook::ns::qwerty::AnEnumA
;
85 static constexpr std::size_t const size
= 1;
86 static folly::Range
<type
const*> const values
;
87 static folly::Range
<folly::StringPiece
const*> const names
;
89 static bool findName(type value
, folly::StringPiece
* out
) noexcept
;
90 static bool findValue(folly::StringPiece name
, type
* out
) noexcept
;
92 #if FOLLY_HAS_STRING_VIEW
93 static bool findName(type value
, std::string_view
* out
) noexcept
{
94 folly::StringPiece outp
;
95 return findName(value
, &outp
) && ((*out
= outp
), true);
98 static char const* findName(type value
) noexcept
{
99 folly::StringPiece ret
;
100 (void)findName(value
, &ret
);
103 static constexpr type
min() { return type::FIELDA
; }
104 static constexpr type
max() { return type::FIELDA
; }
108 template <> struct TEnumDataStorage
<::facebook::ns::qwerty::AnEnumB
>;
110 template <> struct TEnumTraits
<::facebook::ns::qwerty::AnEnumB
> {
111 using type
= ::facebook::ns::qwerty::AnEnumB
;
113 static constexpr std::size_t const size
= 2;
114 static folly::Range
<type
const*> const values
;
115 static folly::Range
<folly::StringPiece
const*> const names
;
117 static bool findName(type value
, folly::StringPiece
* out
) noexcept
;
118 static bool findValue(folly::StringPiece name
, type
* out
) noexcept
;
120 #if FOLLY_HAS_STRING_VIEW
121 static bool findName(type value
, std::string_view
* out
) noexcept
{
122 folly::StringPiece outp
;
123 return findName(value
, &outp
) && ((*out
= outp
), true);
126 static char const* findName(type value
) noexcept
{
127 folly::StringPiece ret
;
128 (void)findName(value
, &ret
);
131 static constexpr type
min() { return type::FIELDA
; }
132 static constexpr type
max() { return type::FIELDB
; }
136 template <> struct TEnumDataStorage
<::facebook::ns::qwerty::AnEnumC
>;
138 template <> struct TEnumTraits
<::facebook::ns::qwerty::AnEnumC
> {
139 using type
= ::facebook::ns::qwerty::AnEnumC
;
141 static constexpr std::size_t const size
= 1;
142 static folly::Range
<type
const*> const values
;
143 static folly::Range
<folly::StringPiece
const*> const names
;
145 static bool findName(type value
, folly::StringPiece
* out
) noexcept
;
146 static bool findValue(folly::StringPiece name
, type
* out
) noexcept
;
148 #if FOLLY_HAS_STRING_VIEW
149 static bool findName(type value
, std::string_view
* out
) noexcept
{
150 folly::StringPiece outp
;
151 return findName(value
, &outp
) && ((*out
= outp
), true);
154 static char const* findName(type value
) noexcept
{
155 folly::StringPiece ret
;
156 (void)findName(value
, &ret
);
159 static constexpr type
min() { return type::FIELDC
; }
160 static constexpr type
max() { return type::FIELDC
; }
164 template <> struct TEnumDataStorage
<::facebook::ns::qwerty::AnEnumD
>;
166 template <> struct TEnumTraits
<::facebook::ns::qwerty::AnEnumD
> {
167 using type
= ::facebook::ns::qwerty::AnEnumD
;
169 static constexpr std::size_t const size
= 1;
170 static folly::Range
<type
const*> const values
;
171 static folly::Range
<folly::StringPiece
const*> const names
;
173 static bool findName(type value
, folly::StringPiece
* out
) noexcept
;
174 static bool findValue(folly::StringPiece name
, type
* out
) noexcept
;
176 #if FOLLY_HAS_STRING_VIEW
177 static bool findName(type value
, std::string_view
* out
) noexcept
{
178 folly::StringPiece outp
;
179 return findName(value
, &outp
) && ((*out
= outp
), true);
182 static char const* findName(type value
) noexcept
{
183 folly::StringPiece ret
;
184 (void)findName(value
, &ret
);
187 static constexpr type
min() { return type::FIELDD
; }
188 static constexpr type
max() { return type::FIELDD
; }
192 template <> struct TEnumDataStorage
<::facebook::ns::qwerty::AnEnumE
>;
194 template <> struct TEnumTraits
<::facebook::ns::qwerty::AnEnumE
> {
195 using type
= ::facebook::ns::qwerty::AnEnumE
;
197 static constexpr std::size_t const size
= 1;
198 static folly::Range
<type
const*> const values
;
199 static folly::Range
<folly::StringPiece
const*> const names
;
201 static bool findName(type value
, folly::StringPiece
* out
) noexcept
;
202 static bool findValue(folly::StringPiece name
, type
* out
) noexcept
;
204 #if FOLLY_HAS_STRING_VIEW
205 static bool findName(type value
, std::string_view
* out
) noexcept
{
206 folly::StringPiece outp
;
207 return findName(value
, &outp
) && ((*out
= outp
), true);
210 static char const* findName(type value
) noexcept
{
211 folly::StringPiece ret
;
212 (void)findName(value
, &ret
);
215 static constexpr type
min() { return type::FIELDA
; }
216 static constexpr type
max() { return type::FIELDA
; }
222 namespace facebook
{ namespace ns
{ namespace qwerty
{
224 using _AnEnumA_EnumMapFactory
= apache::thrift::detail::TEnumMapFactory
<AnEnumA
>;
226 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
227 extern const _AnEnumA_EnumMapFactory::ValuesToNamesMapType _AnEnumA_VALUES_TO_NAMES
;
228 [[deprecated("use apache::thrift::TEnumTraits")]]
229 extern const _AnEnumA_EnumMapFactory::NamesToValuesMapType _AnEnumA_NAMES_TO_VALUES
;
231 using _AnEnumB_EnumMapFactory
= apache::thrift::detail::TEnumMapFactory
<AnEnumB
>;
233 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
234 extern const _AnEnumB_EnumMapFactory::ValuesToNamesMapType _AnEnumB_VALUES_TO_NAMES
;
235 [[deprecated("use apache::thrift::TEnumTraits")]]
236 extern const _AnEnumB_EnumMapFactory::NamesToValuesMapType _AnEnumB_NAMES_TO_VALUES
;
238 using _AnEnumC_EnumMapFactory
= apache::thrift::detail::TEnumMapFactory
<AnEnumC
>;
240 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
241 extern const _AnEnumC_EnumMapFactory::ValuesToNamesMapType _AnEnumC_VALUES_TO_NAMES
;
242 [[deprecated("use apache::thrift::TEnumTraits")]]
243 extern const _AnEnumC_EnumMapFactory::NamesToValuesMapType _AnEnumC_NAMES_TO_VALUES
;
245 using _AnEnumD_EnumMapFactory
= apache::thrift::detail::TEnumMapFactory
<AnEnumD
>;
247 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
248 extern const _AnEnumD_EnumMapFactory::ValuesToNamesMapType _AnEnumD_VALUES_TO_NAMES
;
249 [[deprecated("use apache::thrift::TEnumTraits")]]
250 extern const _AnEnumD_EnumMapFactory::NamesToValuesMapType _AnEnumD_NAMES_TO_VALUES
;
252 using _AnEnumE_EnumMapFactory
= apache::thrift::detail::TEnumMapFactory
<AnEnumE
>;
254 [[deprecated("use apache::thrift::util::enumNameSafe, apache::thrift::util::enumName, or apache::thrift::TEnumTraits")]]
255 extern const _AnEnumE_EnumMapFactory::ValuesToNamesMapType _AnEnumE_VALUES_TO_NAMES
;
256 [[deprecated("use apache::thrift::TEnumTraits")]]
257 extern const _AnEnumE_EnumMapFactory::NamesToValuesMapType _AnEnumE_NAMES_TO_VALUES
;
259 }}} // facebook::ns::qwerty
262 // BEGIN forward_declare
263 namespace facebook
{ namespace ns
{ namespace qwerty
{
265 }}} // facebook::ns::qwerty
266 // END forward_declare
267 // BEGIN hash_and_equal_to
268 // END hash_and_equal_to
269 namespace facebook
{ namespace ns
{ namespace qwerty
{
270 using ::apache::thrift::detail::operator!=;
271 using ::apache::thrift::detail::operator>;
272 using ::apache::thrift::detail::operator<=;
273 using ::apache::thrift::detail::operator>=;
276 class SomeStruct final
{
278 friend struct ::apache::thrift::detail::st::struct_private_access
;
279 template<class> friend struct ::apache::thrift::detail::invoke_reffer
;
281 // used by a static_assert in the corresponding source
282 static constexpr bool __fbthrift_cpp2_gen_json
= true;
283 static const folly::StringPiece
__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord
);
285 void __fbthrift_clear();
286 void __fbthrift_clear_terse_fields();
287 bool __fbthrift_is_empty() const;
290 using __fbthrift_cpp2_type
= SomeStruct
;
291 static constexpr bool __fbthrift_cpp2_is_union
=
298 __fbthrift_field_fieldA() {
300 // FragileConstructor for use in initialization lists only.
301 [[deprecated("This constructor is deprecated")]]
302 SomeStruct(apache::thrift::FragileConstructor
, ::std::int32_t fieldA__arg
);
304 SomeStruct(SomeStruct
&&) = default;
306 SomeStruct(const SomeStruct
&) = default;
309 SomeStruct
& operator=(SomeStruct
&&) = default;
311 SomeStruct
& operator=(const SomeStruct
&) = default;
313 ::std::int32_t __fbthrift_field_fieldA
;
315 apache::thrift::detail::isset_bitset
<1, apache::thrift::detail::IssetBitsetOption::Unpacked
> __isset
;
319 bool operator==(const SomeStruct
&) const;
320 bool operator<(const SomeStruct
&) const;
322 template <typename
..., typename T
= ::std::int32_t>
323 FOLLY_ERASE ::apache::thrift::field_ref
<const T
&> fieldA_ref() const& {
324 return {this->__fbthrift_field_fieldA
, __isset
.at(0), __isset
.bit(0)};
327 template <typename
..., typename T
= ::std::int32_t>
328 FOLLY_ERASE ::apache::thrift::field_ref
<const T
&&> fieldA_ref() const&& {
329 return {static_cast<const T
&&>(this->__fbthrift_field_fieldA
), __isset
.at(0), __isset
.bit(0)};
332 template <typename
..., typename T
= ::std::int32_t>
333 FOLLY_ERASE ::apache::thrift::field_ref
<T
&> fieldA_ref() & {
334 return {this->__fbthrift_field_fieldA
, __isset
.at(0), __isset
.bit(0)};
337 template <typename
..., typename T
= ::std::int32_t>
338 FOLLY_ERASE ::apache::thrift::field_ref
<T
&&> fieldA_ref() && {
339 return {static_cast<T
&&>(this->__fbthrift_field_fieldA
), __isset
.at(0), __isset
.bit(0)};
342 template <typename
..., typename T
= ::std::int32_t>
343 FOLLY_ERASE ::apache::thrift::field_ref
<const T
&> fieldA() const& {
344 return {this->__fbthrift_field_fieldA
, __isset
.at(0), __isset
.bit(0)};
347 template <typename
..., typename T
= ::std::int32_t>
348 FOLLY_ERASE ::apache::thrift::field_ref
<const T
&&> fieldA() const&& {
349 return {static_cast<const T
&&>(this->__fbthrift_field_fieldA
), __isset
.at(0), __isset
.bit(0)};
352 template <typename
..., typename T
= ::std::int32_t>
353 FOLLY_ERASE ::apache::thrift::field_ref
<T
&> fieldA() & {
354 return {this->__fbthrift_field_fieldA
, __isset
.at(0), __isset
.bit(0)};
357 template <typename
..., typename T
= ::std::int32_t>
358 FOLLY_ERASE ::apache::thrift::field_ref
<T
&&> fieldA() && {
359 return {static_cast<T
&&>(this->__fbthrift_field_fieldA
), __isset
.at(0), __isset
.bit(0)};
362 ::std::int32_t get_fieldA() const {
363 return __fbthrift_field_fieldA
;
366 [[deprecated("Use `FOO.fieldA_ref() = BAR;` instead of `FOO.set_fieldA(BAR);`")]]
367 ::std::int32_t& set_fieldA(::std::int32_t fieldA_
) {
368 fieldA_ref() = fieldA_
;
369 return __fbthrift_field_fieldA
;
372 template <class Protocol_
>
373 unsigned long read(Protocol_
* iprot
);
374 template <class Protocol_
>
375 uint32_t serializedSize(Protocol_
const* prot_
) const;
376 template <class Protocol_
>
377 uint32_t serializedSizeZC(Protocol_
const* prot_
) const;
378 template <class Protocol_
>
379 uint32_t write(Protocol_
* prot_
) const;
382 template <class Protocol_
>
383 void readNoXfer(Protocol_
* iprot
);
385 friend class ::apache::thrift::Cpp2Ops
<SomeStruct
>;
386 friend void swap(SomeStruct
& a
, SomeStruct
& b
);
389 template <class Protocol_
>
390 unsigned long SomeStruct::read(Protocol_
* iprot
) {
391 auto _xferStart
= iprot
->getCursorPosition();
393 return iprot
->getCursorPosition() - _xferStart
;
397 }}} // facebook::ns::qwerty