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 } // namespace tag
17 namespace detail {
18 } // namespace detail
19 } // namespace thrift
20 } // namespace apache
21 
22 // BEGIN declare_enums
23 
24 // END declare_enums
25 // BEGIN forward_declare
26 namespace cpp2 {
27 class Empty;
28 class Nada;
29 } // cpp2
30 // END forward_declare
31 // BEGIN typedefs
32 
33 // END typedefs
34 // BEGIN hash_and_equal_to
35 // END hash_and_equal_to
36 namespace cpp2 {
37 using ::apache::thrift::detail::operator!=;
38 using ::apache::thrift::detail::operator>;
39 using ::apache::thrift::detail::operator<=;
40 using ::apache::thrift::detail::operator>=;
41 } // cpp2
42 namespace cpp2 {
43 class Empty final  {
44  private:
45   friend struct ::apache::thrift::detail::st::struct_private_access;
46 
47   //  used by a static_assert in the corresponding source
48   static constexpr bool __fbthrift_cpp2_gen_json = false;
49   static constexpr bool __fbthrift_cpp2_gen_nimble = false;
50   static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false;
51 
52   void __fbthrift_clear();
53 
54  public:
55   using __fbthrift_cpp2_type = Empty;
56   static constexpr bool __fbthrift_cpp2_is_union =
57     false;
58 
59 
60  public:
61 
Empty()62   Empty() {
63   }
64   // FragileConstructor for use in initialization lists only.
65   [[deprecated("This constructor is deprecated")]]
66   Empty(apache::thrift::FragileConstructor);
67 
68   Empty(Empty&&) = default;
69 
70   Empty(const Empty&) = default;
71 
72 
73   Empty& operator=(Empty&&) = default;
74 
75   Empty& operator=(const Empty&) = default;
76 
77  public:
78 
79   bool operator==(const Empty&) const;
80   bool operator<(const Empty&) const;
81 
82   template <class Protocol_>
83   uint32_t read(Protocol_* iprot);
84   template <class Protocol_>
85   uint32_t serializedSize(Protocol_ const* prot_) const;
86   template <class Protocol_>
87   uint32_t serializedSizeZC(Protocol_ const* prot_) const;
88   template <class Protocol_>
89   uint32_t write(Protocol_* prot_) const;
90 
91  private:
92   template <class Protocol_>
93   void readNoXfer(Protocol_* iprot);
94 
95   friend class ::apache::thrift::Cpp2Ops<Empty>;
96   friend void swap(Empty& a, Empty& b);
97 };
98 
99 template <class Protocol_>
read(Protocol_ * iprot)100 uint32_t Empty::read(Protocol_* iprot) {
101   auto _xferStart = iprot->getCursorPosition();
102   readNoXfer(iprot);
103   return iprot->getCursorPosition() - _xferStart;
104 }
105 
106 } // cpp2
107 namespace cpp2 {
108 class Nada final  {
109  private:
110   friend struct ::apache::thrift::detail::st::struct_private_access;
111 
112   //  used by a static_assert in the corresponding source
113   static constexpr bool __fbthrift_cpp2_gen_json = false;
114   static constexpr bool __fbthrift_cpp2_gen_nimble = false;
115   static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false;
116 
117   void __fbthrift_clear();
118 
119  public:
120   using __fbthrift_cpp2_type = Nada;
121   static constexpr bool __fbthrift_cpp2_is_union =
122     true;
123 
124 
125  public:
126   enum Type : int {
127     __EMPTY__ = 0,
128   } ;
129 
Nada()130   Nada()
131       : type_(Type::__EMPTY__) {}
132 
Nada(Nada && rhs)133   Nada(Nada&& rhs) noexcept
134       : type_(Type::__EMPTY__) {
135     if (this == &rhs) { return; }
136     if (rhs.type_ == Type::__EMPTY__) { return; }
137     switch (rhs.type_) {
138       default:
139       {
140         assert(false);
141         break;
142       }
143     }
144     apache::thrift::clear(rhs);
145   }
146 
Nada(const Nada & rhs)147   Nada(const Nada& rhs)
148       : type_(Type::__EMPTY__) {
149     if (this == &rhs) { return; }
150     if (rhs.type_ == Type::__EMPTY__) { return; }
151     switch (rhs.type_) {
152       default:
153       {
154         assert(false);
155         break;
156       }
157     }
158   }
159 
160   Nada& operator=(Nada&& rhs) noexcept {
161     if (this == &rhs) { return *this; }
162     __fbthrift_clear();
163     if (rhs.type_ == Type::__EMPTY__) { return *this; }
164     switch (rhs.type_) {
165       default:
166       {
167         assert(false);
168         break;
169       }
170     }
171     apache::thrift::clear(rhs);
172     return *this;
173   }
174 
175   Nada& operator=(const Nada& rhs) {
176     if (this == &rhs) { return *this; }
177     __fbthrift_clear();
178     if (rhs.type_ == Type::__EMPTY__) { return *this; }
179     switch (rhs.type_) {
180       default:
181       {
182         assert(false);
183         break;
184       }
185     }
186     return *this;
187   }
188 
~Nada()189   ~Nada() {
190     apache::thrift::clear(*this);
191   }
192   union storage_type {
193 
storage_type()194     storage_type() {}
~storage_type()195     ~storage_type() {}
196   } ;
197 
198   bool operator==(const Nada&) const;
199   bool operator<(const Nada&) const;
200 
getType()201   Type getType() const { return static_cast<Type>(type_); }
202 
203   template <class Protocol_>
204   uint32_t read(Protocol_* iprot);
205   template <class Protocol_>
206   uint32_t serializedSize(Protocol_ const* prot_) const;
207   template <class Protocol_>
208   uint32_t serializedSizeZC(Protocol_ const* prot_) const;
209   template <class Protocol_>
210   uint32_t write(Protocol_* prot_) const;
211  protected:
212   template <class T>
destruct(T & val)213   void destruct(T &val) {
214     (&val)->~T();
215   }
216 
217   storage_type value_;
218   std::underlying_type_t<Type> type_;
219 
220  private:
221   template <class Protocol_>
222   void readNoXfer(Protocol_* iprot);
223 
224   friend class ::apache::thrift::Cpp2Ops<Nada>;
225   friend void swap(Nada& a, Nada& b);
226 };
227 
228 template <class Protocol_>
read(Protocol_ * iprot)229 uint32_t Nada::read(Protocol_* iprot) {
230   auto _xferStart = iprot->getCursorPosition();
231   readNoXfer(iprot);
232   return iprot->getCursorPosition() - _xferStart;
233 }
234 
235 } // cpp2
236 
237 namespace apache { namespace thrift {
238 
239 template <> struct TEnumDataStorage<::cpp2::Nada::Type>;
240 
241 template <> struct TEnumTraits<::cpp2::Nada::Type> {
242   using type = ::cpp2::Nada::Type;
243 
244   static constexpr std::size_t const size = 0;
245   static folly::Range<type const*> const values;
246   static folly::Range<folly::StringPiece const*> const names;
247 
248   static char const* findName(type value);
249   static bool findValue(char const* name, type* out);
250 
251 };
252 }} // apache::thrift
253