unittest_preserve_unknown_enum.pb.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_preserve_unknown_enum.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto
  5. #include <string>
  6. #include <google/protobuf/stubs/common.h>
  7. #if GOOGLE_PROTOBUF_VERSION < 3006001
  8. #error This file was generated by a newer version of protoc which is
  9. #error incompatible with your Protocol Buffer headers. Please update
  10. #error your headers.
  11. #endif
  12. #if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
  13. #error This file was generated by an older version of protoc which is
  14. #error incompatible with your Protocol Buffer headers. Please
  15. #error regenerate this file with a newer version of protoc.
  16. #endif
  17. #include <google/protobuf/io/coded_stream.h>
  18. #include <google/protobuf/arena.h>
  19. #include <google/protobuf/arenastring.h>
  20. #include <google/protobuf/generated_message_table_driven.h>
  21. #include <google/protobuf/generated_message_util.h>
  22. #include <google/protobuf/inlined_string_field.h>
  23. #include <google/protobuf/metadata.h>
  24. #include <google/protobuf/message.h>
  25. #include <google/protobuf/repeated_field.h> // IWYU pragma: export
  26. #include <google/protobuf/extension_set.h> // IWYU pragma: export
  27. #include <google/protobuf/generated_enum_reflection.h>
  28. #include <google/protobuf/unknown_field_set.h>
  29. // @@protoc_insertion_point(includes)
  30. #define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto
  31. namespace protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto {
  32. // Internal implementation detail -- do not use these members.
  33. struct TableStruct {
  34. static const ::google::protobuf::internal::ParseTableField entries[];
  35. static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  36. static const ::google::protobuf::internal::ParseTable schema[2];
  37. static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  38. static const ::google::protobuf::internal::SerializationTable serialization_table[];
  39. static const ::google::protobuf::uint32 offsets[];
  40. };
  41. void AddDescriptors();
  42. } // namespace protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto
  43. namespace proto3_preserve_unknown_enum_unittest {
  44. class MyMessage;
  45. class MyMessageDefaultTypeInternal;
  46. extern MyMessageDefaultTypeInternal _MyMessage_default_instance_;
  47. class MyMessagePlusExtra;
  48. class MyMessagePlusExtraDefaultTypeInternal;
  49. extern MyMessagePlusExtraDefaultTypeInternal _MyMessagePlusExtra_default_instance_;
  50. } // namespace proto3_preserve_unknown_enum_unittest
  51. namespace google {
  52. namespace protobuf {
  53. template<> ::proto3_preserve_unknown_enum_unittest::MyMessage* Arena::CreateMaybeMessage<::proto3_preserve_unknown_enum_unittest::MyMessage>(Arena*);
  54. template<> ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra* Arena::CreateMaybeMessage<::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra>(Arena*);
  55. } // namespace protobuf
  56. } // namespace google
  57. namespace proto3_preserve_unknown_enum_unittest {
  58. enum MyEnum {
  59. FOO = 0,
  60. BAR = 1,
  61. BAZ = 2,
  62. MyEnum_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
  63. MyEnum_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
  64. };
  65. bool MyEnum_IsValid(int value);
  66. const MyEnum MyEnum_MIN = FOO;
  67. const MyEnum MyEnum_MAX = BAZ;
  68. const int MyEnum_ARRAYSIZE = MyEnum_MAX + 1;
  69. const ::google::protobuf::EnumDescriptor* MyEnum_descriptor();
  70. inline const ::std::string& MyEnum_Name(MyEnum value) {
  71. return ::google::protobuf::internal::NameOfEnum(
  72. MyEnum_descriptor(), value);
  73. }
  74. inline bool MyEnum_Parse(
  75. const ::std::string& name, MyEnum* value) {
  76. return ::google::protobuf::internal::ParseNamedEnum<MyEnum>(
  77. MyEnum_descriptor(), name, value);
  78. }
  79. enum MyEnumPlusExtra {
  80. E_FOO = 0,
  81. E_BAR = 1,
  82. E_BAZ = 2,
  83. E_EXTRA = 3,
  84. MyEnumPlusExtra_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,
  85. MyEnumPlusExtra_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max
  86. };
  87. bool MyEnumPlusExtra_IsValid(int value);
  88. const MyEnumPlusExtra MyEnumPlusExtra_MIN = E_FOO;
  89. const MyEnumPlusExtra MyEnumPlusExtra_MAX = E_EXTRA;
  90. const int MyEnumPlusExtra_ARRAYSIZE = MyEnumPlusExtra_MAX + 1;
  91. const ::google::protobuf::EnumDescriptor* MyEnumPlusExtra_descriptor();
  92. inline const ::std::string& MyEnumPlusExtra_Name(MyEnumPlusExtra value) {
  93. return ::google::protobuf::internal::NameOfEnum(
  94. MyEnumPlusExtra_descriptor(), value);
  95. }
  96. inline bool MyEnumPlusExtra_Parse(
  97. const ::std::string& name, MyEnumPlusExtra* value) {
  98. return ::google::protobuf::internal::ParseNamedEnum<MyEnumPlusExtra>(
  99. MyEnumPlusExtra_descriptor(), name, value);
  100. }
  101. // ===================================================================
  102. class MyMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto3_preserve_unknown_enum_unittest.MyMessage) */ {
  103. public:
  104. MyMessage();
  105. virtual ~MyMessage();
  106. MyMessage(const MyMessage& from);
  107. inline MyMessage& operator=(const MyMessage& from) {
  108. CopyFrom(from);
  109. return *this;
  110. }
  111. #if LANG_CXX11
  112. MyMessage(MyMessage&& from) noexcept
  113. : MyMessage() {
  114. *this = ::std::move(from);
  115. }
  116. inline MyMessage& operator=(MyMessage&& from) noexcept {
  117. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  118. if (this != &from) InternalSwap(&from);
  119. } else {
  120. CopyFrom(from);
  121. }
  122. return *this;
  123. }
  124. #endif
  125. static const ::google::protobuf::Descriptor* descriptor();
  126. static const MyMessage& default_instance();
  127. enum OCase {
  128. kOneofE1 = 5,
  129. kOneofE2 = 6,
  130. O_NOT_SET = 0,
  131. };
  132. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  133. static inline const MyMessage* internal_default_instance() {
  134. return reinterpret_cast<const MyMessage*>(
  135. &_MyMessage_default_instance_);
  136. }
  137. static constexpr int kIndexInFileMessages =
  138. 0;
  139. void Swap(MyMessage* other);
  140. friend void swap(MyMessage& a, MyMessage& b) {
  141. a.Swap(&b);
  142. }
  143. // implements Message ----------------------------------------------
  144. inline MyMessage* New() const final {
  145. return CreateMaybeMessage<MyMessage>(NULL);
  146. }
  147. MyMessage* New(::google::protobuf::Arena* arena) const final {
  148. return CreateMaybeMessage<MyMessage>(arena);
  149. }
  150. void CopyFrom(const ::google::protobuf::Message& from) final;
  151. void MergeFrom(const ::google::protobuf::Message& from) final;
  152. void CopyFrom(const MyMessage& from);
  153. void MergeFrom(const MyMessage& from);
  154. void Clear() final;
  155. bool IsInitialized() const final;
  156. size_t ByteSizeLong() const final;
  157. bool MergePartialFromCodedStream(
  158. ::google::protobuf::io::CodedInputStream* input) final;
  159. void SerializeWithCachedSizes(
  160. ::google::protobuf::io::CodedOutputStream* output) const final;
  161. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  162. bool deterministic, ::google::protobuf::uint8* target) const final;
  163. int GetCachedSize() const final { return _cached_size_.Get(); }
  164. private:
  165. void SharedCtor();
  166. void SharedDtor();
  167. void SetCachedSize(int size) const final;
  168. void InternalSwap(MyMessage* other);
  169. private:
  170. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  171. return NULL;
  172. }
  173. inline void* MaybeArenaPtr() const {
  174. return NULL;
  175. }
  176. public:
  177. ::google::protobuf::Metadata GetMetadata() const final;
  178. // nested types ----------------------------------------------------
  179. // accessors -------------------------------------------------------
  180. // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
  181. int repeated_e_size() const;
  182. void clear_repeated_e();
  183. static const int kRepeatedEFieldNumber = 2;
  184. ::proto3_preserve_unknown_enum_unittest::MyEnum repeated_e(int index) const;
  185. void set_repeated_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnum value);
  186. void add_repeated_e(::proto3_preserve_unknown_enum_unittest::MyEnum value);
  187. const ::google::protobuf::RepeatedField<int>& repeated_e() const;
  188. ::google::protobuf::RepeatedField<int>* mutable_repeated_e();
  189. // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
  190. int repeated_packed_e_size() const;
  191. void clear_repeated_packed_e();
  192. static const int kRepeatedPackedEFieldNumber = 3;
  193. ::proto3_preserve_unknown_enum_unittest::MyEnum repeated_packed_e(int index) const;
  194. void set_repeated_packed_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnum value);
  195. void add_repeated_packed_e(::proto3_preserve_unknown_enum_unittest::MyEnum value);
  196. const ::google::protobuf::RepeatedField<int>& repeated_packed_e() const;
  197. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_e();
  198. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
  199. int repeated_packed_unexpected_e_size() const;
  200. void clear_repeated_packed_unexpected_e();
  201. static const int kRepeatedPackedUnexpectedEFieldNumber = 4;
  202. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra repeated_packed_unexpected_e(int index) const;
  203. void set_repeated_packed_unexpected_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  204. void add_repeated_packed_unexpected_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  205. const ::google::protobuf::RepeatedField<int>& repeated_packed_unexpected_e() const;
  206. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_unexpected_e();
  207. // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
  208. void clear_e();
  209. static const int kEFieldNumber = 1;
  210. ::proto3_preserve_unknown_enum_unittest::MyEnum e() const;
  211. void set_e(::proto3_preserve_unknown_enum_unittest::MyEnum value);
  212. // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
  213. private:
  214. bool has_oneof_e_1() const;
  215. public:
  216. void clear_oneof_e_1();
  217. static const int kOneofE1FieldNumber = 5;
  218. ::proto3_preserve_unknown_enum_unittest::MyEnum oneof_e_1() const;
  219. void set_oneof_e_1(::proto3_preserve_unknown_enum_unittest::MyEnum value);
  220. // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
  221. private:
  222. bool has_oneof_e_2() const;
  223. public:
  224. void clear_oneof_e_2();
  225. static const int kOneofE2FieldNumber = 6;
  226. ::proto3_preserve_unknown_enum_unittest::MyEnum oneof_e_2() const;
  227. void set_oneof_e_2(::proto3_preserve_unknown_enum_unittest::MyEnum value);
  228. void clear_o();
  229. OCase o_case() const;
  230. // @@protoc_insertion_point(class_scope:proto3_preserve_unknown_enum_unittest.MyMessage)
  231. private:
  232. void set_has_oneof_e_1();
  233. void set_has_oneof_e_2();
  234. inline bool has_o() const;
  235. inline void clear_has_o();
  236. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  237. ::google::protobuf::RepeatedField<int> repeated_e_;
  238. mutable int _repeated_e_cached_byte_size_;
  239. ::google::protobuf::RepeatedField<int> repeated_packed_e_;
  240. mutable int _repeated_packed_e_cached_byte_size_;
  241. ::google::protobuf::RepeatedField<int> repeated_packed_unexpected_e_;
  242. mutable int _repeated_packed_unexpected_e_cached_byte_size_;
  243. int e_;
  244. union OUnion {
  245. OUnion() {}
  246. int oneof_e_1_;
  247. int oneof_e_2_;
  248. } o_;
  249. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  250. ::google::protobuf::uint32 _oneof_case_[1];
  251. friend struct ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::TableStruct;
  252. };
  253. // -------------------------------------------------------------------
  254. class MyMessagePlusExtra : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra) */ {
  255. public:
  256. MyMessagePlusExtra();
  257. virtual ~MyMessagePlusExtra();
  258. MyMessagePlusExtra(const MyMessagePlusExtra& from);
  259. inline MyMessagePlusExtra& operator=(const MyMessagePlusExtra& from) {
  260. CopyFrom(from);
  261. return *this;
  262. }
  263. #if LANG_CXX11
  264. MyMessagePlusExtra(MyMessagePlusExtra&& from) noexcept
  265. : MyMessagePlusExtra() {
  266. *this = ::std::move(from);
  267. }
  268. inline MyMessagePlusExtra& operator=(MyMessagePlusExtra&& from) noexcept {
  269. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  270. if (this != &from) InternalSwap(&from);
  271. } else {
  272. CopyFrom(from);
  273. }
  274. return *this;
  275. }
  276. #endif
  277. static const ::google::protobuf::Descriptor* descriptor();
  278. static const MyMessagePlusExtra& default_instance();
  279. enum OCase {
  280. kOneofE1 = 5,
  281. kOneofE2 = 6,
  282. O_NOT_SET = 0,
  283. };
  284. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  285. static inline const MyMessagePlusExtra* internal_default_instance() {
  286. return reinterpret_cast<const MyMessagePlusExtra*>(
  287. &_MyMessagePlusExtra_default_instance_);
  288. }
  289. static constexpr int kIndexInFileMessages =
  290. 1;
  291. void Swap(MyMessagePlusExtra* other);
  292. friend void swap(MyMessagePlusExtra& a, MyMessagePlusExtra& b) {
  293. a.Swap(&b);
  294. }
  295. // implements Message ----------------------------------------------
  296. inline MyMessagePlusExtra* New() const final {
  297. return CreateMaybeMessage<MyMessagePlusExtra>(NULL);
  298. }
  299. MyMessagePlusExtra* New(::google::protobuf::Arena* arena) const final {
  300. return CreateMaybeMessage<MyMessagePlusExtra>(arena);
  301. }
  302. void CopyFrom(const ::google::protobuf::Message& from) final;
  303. void MergeFrom(const ::google::protobuf::Message& from) final;
  304. void CopyFrom(const MyMessagePlusExtra& from);
  305. void MergeFrom(const MyMessagePlusExtra& from);
  306. void Clear() final;
  307. bool IsInitialized() const final;
  308. size_t ByteSizeLong() const final;
  309. bool MergePartialFromCodedStream(
  310. ::google::protobuf::io::CodedInputStream* input) final;
  311. void SerializeWithCachedSizes(
  312. ::google::protobuf::io::CodedOutputStream* output) const final;
  313. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  314. bool deterministic, ::google::protobuf::uint8* target) const final;
  315. int GetCachedSize() const final { return _cached_size_.Get(); }
  316. private:
  317. void SharedCtor();
  318. void SharedDtor();
  319. void SetCachedSize(int size) const final;
  320. void InternalSwap(MyMessagePlusExtra* other);
  321. private:
  322. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  323. return NULL;
  324. }
  325. inline void* MaybeArenaPtr() const {
  326. return NULL;
  327. }
  328. public:
  329. ::google::protobuf::Metadata GetMetadata() const final;
  330. // nested types ----------------------------------------------------
  331. // accessors -------------------------------------------------------
  332. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
  333. int repeated_e_size() const;
  334. void clear_repeated_e();
  335. static const int kRepeatedEFieldNumber = 2;
  336. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra repeated_e(int index) const;
  337. void set_repeated_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  338. void add_repeated_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  339. const ::google::protobuf::RepeatedField<int>& repeated_e() const;
  340. ::google::protobuf::RepeatedField<int>* mutable_repeated_e();
  341. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
  342. int repeated_packed_e_size() const;
  343. void clear_repeated_packed_e();
  344. static const int kRepeatedPackedEFieldNumber = 3;
  345. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra repeated_packed_e(int index) const;
  346. void set_repeated_packed_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  347. void add_repeated_packed_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  348. const ::google::protobuf::RepeatedField<int>& repeated_packed_e() const;
  349. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_e();
  350. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
  351. int repeated_packed_unexpected_e_size() const;
  352. void clear_repeated_packed_unexpected_e();
  353. static const int kRepeatedPackedUnexpectedEFieldNumber = 4;
  354. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra repeated_packed_unexpected_e(int index) const;
  355. void set_repeated_packed_unexpected_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  356. void add_repeated_packed_unexpected_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  357. const ::google::protobuf::RepeatedField<int>& repeated_packed_unexpected_e() const;
  358. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_unexpected_e();
  359. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
  360. void clear_e();
  361. static const int kEFieldNumber = 1;
  362. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra e() const;
  363. void set_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  364. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
  365. private:
  366. bool has_oneof_e_1() const;
  367. public:
  368. void clear_oneof_e_1();
  369. static const int kOneofE1FieldNumber = 5;
  370. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra oneof_e_1() const;
  371. void set_oneof_e_1(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  372. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
  373. private:
  374. bool has_oneof_e_2() const;
  375. public:
  376. void clear_oneof_e_2();
  377. static const int kOneofE2FieldNumber = 6;
  378. ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra oneof_e_2() const;
  379. void set_oneof_e_2(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value);
  380. void clear_o();
  381. OCase o_case() const;
  382. // @@protoc_insertion_point(class_scope:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
  383. private:
  384. void set_has_oneof_e_1();
  385. void set_has_oneof_e_2();
  386. inline bool has_o() const;
  387. inline void clear_has_o();
  388. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  389. ::google::protobuf::RepeatedField<int> repeated_e_;
  390. mutable int _repeated_e_cached_byte_size_;
  391. ::google::protobuf::RepeatedField<int> repeated_packed_e_;
  392. mutable int _repeated_packed_e_cached_byte_size_;
  393. ::google::protobuf::RepeatedField<int> repeated_packed_unexpected_e_;
  394. mutable int _repeated_packed_unexpected_e_cached_byte_size_;
  395. int e_;
  396. union OUnion {
  397. OUnion() {}
  398. int oneof_e_1_;
  399. int oneof_e_2_;
  400. } o_;
  401. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  402. ::google::protobuf::uint32 _oneof_case_[1];
  403. friend struct ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::TableStruct;
  404. };
  405. // ===================================================================
  406. // ===================================================================
  407. #ifdef __GNUC__
  408. #pragma GCC diagnostic push
  409. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  410. #endif // __GNUC__
  411. // MyMessage
  412. // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
  413. inline void MyMessage::clear_e() {
  414. e_ = 0;
  415. }
  416. inline ::proto3_preserve_unknown_enum_unittest::MyEnum MyMessage::e() const {
  417. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.e)
  418. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(e_);
  419. }
  420. inline void MyMessage::set_e(::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  421. e_ = value;
  422. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.e)
  423. }
  424. // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
  425. inline int MyMessage::repeated_e_size() const {
  426. return repeated_e_.size();
  427. }
  428. inline void MyMessage::clear_repeated_e() {
  429. repeated_e_.Clear();
  430. }
  431. inline ::proto3_preserve_unknown_enum_unittest::MyEnum MyMessage::repeated_e(int index) const {
  432. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  433. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(repeated_e_.Get(index));
  434. }
  435. inline void MyMessage::set_repeated_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  436. repeated_e_.Set(index, value);
  437. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  438. }
  439. inline void MyMessage::add_repeated_e(::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  440. repeated_e_.Add(value);
  441. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  442. }
  443. inline const ::google::protobuf::RepeatedField<int>&
  444. MyMessage::repeated_e() const {
  445. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  446. return repeated_e_;
  447. }
  448. inline ::google::protobuf::RepeatedField<int>*
  449. MyMessage::mutable_repeated_e() {
  450. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  451. return &repeated_e_;
  452. }
  453. // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
  454. inline int MyMessage::repeated_packed_e_size() const {
  455. return repeated_packed_e_.size();
  456. }
  457. inline void MyMessage::clear_repeated_packed_e() {
  458. repeated_packed_e_.Clear();
  459. }
  460. inline ::proto3_preserve_unknown_enum_unittest::MyEnum MyMessage::repeated_packed_e(int index) const {
  461. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  462. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(repeated_packed_e_.Get(index));
  463. }
  464. inline void MyMessage::set_repeated_packed_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  465. repeated_packed_e_.Set(index, value);
  466. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  467. }
  468. inline void MyMessage::add_repeated_packed_e(::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  469. repeated_packed_e_.Add(value);
  470. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  471. }
  472. inline const ::google::protobuf::RepeatedField<int>&
  473. MyMessage::repeated_packed_e() const {
  474. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  475. return repeated_packed_e_;
  476. }
  477. inline ::google::protobuf::RepeatedField<int>*
  478. MyMessage::mutable_repeated_packed_e() {
  479. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  480. return &repeated_packed_e_;
  481. }
  482. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
  483. inline int MyMessage::repeated_packed_unexpected_e_size() const {
  484. return repeated_packed_unexpected_e_.size();
  485. }
  486. inline void MyMessage::clear_repeated_packed_unexpected_e() {
  487. repeated_packed_unexpected_e_.Clear();
  488. }
  489. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessage::repeated_packed_unexpected_e(int index) const {
  490. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  491. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(repeated_packed_unexpected_e_.Get(index));
  492. }
  493. inline void MyMessage::set_repeated_packed_unexpected_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  494. repeated_packed_unexpected_e_.Set(index, value);
  495. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  496. }
  497. inline void MyMessage::add_repeated_packed_unexpected_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  498. repeated_packed_unexpected_e_.Add(value);
  499. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  500. }
  501. inline const ::google::protobuf::RepeatedField<int>&
  502. MyMessage::repeated_packed_unexpected_e() const {
  503. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  504. return repeated_packed_unexpected_e_;
  505. }
  506. inline ::google::protobuf::RepeatedField<int>*
  507. MyMessage::mutable_repeated_packed_unexpected_e() {
  508. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  509. return &repeated_packed_unexpected_e_;
  510. }
  511. // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
  512. inline bool MyMessage::has_oneof_e_1() const {
  513. return o_case() == kOneofE1;
  514. }
  515. inline void MyMessage::set_has_oneof_e_1() {
  516. _oneof_case_[0] = kOneofE1;
  517. }
  518. inline void MyMessage::clear_oneof_e_1() {
  519. if (has_oneof_e_1()) {
  520. o_.oneof_e_1_ = 0;
  521. clear_has_o();
  522. }
  523. }
  524. inline ::proto3_preserve_unknown_enum_unittest::MyEnum MyMessage::oneof_e_1() const {
  525. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.oneof_e_1)
  526. if (has_oneof_e_1()) {
  527. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(o_.oneof_e_1_);
  528. }
  529. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(0);
  530. }
  531. inline void MyMessage::set_oneof_e_1(::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  532. if (!has_oneof_e_1()) {
  533. clear_o();
  534. set_has_oneof_e_1();
  535. }
  536. o_.oneof_e_1_ = value;
  537. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.oneof_e_1)
  538. }
  539. // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
  540. inline bool MyMessage::has_oneof_e_2() const {
  541. return o_case() == kOneofE2;
  542. }
  543. inline void MyMessage::set_has_oneof_e_2() {
  544. _oneof_case_[0] = kOneofE2;
  545. }
  546. inline void MyMessage::clear_oneof_e_2() {
  547. if (has_oneof_e_2()) {
  548. o_.oneof_e_2_ = 0;
  549. clear_has_o();
  550. }
  551. }
  552. inline ::proto3_preserve_unknown_enum_unittest::MyEnum MyMessage::oneof_e_2() const {
  553. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessage.oneof_e_2)
  554. if (has_oneof_e_2()) {
  555. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(o_.oneof_e_2_);
  556. }
  557. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(0);
  558. }
  559. inline void MyMessage::set_oneof_e_2(::proto3_preserve_unknown_enum_unittest::MyEnum value) {
  560. if (!has_oneof_e_2()) {
  561. clear_o();
  562. set_has_oneof_e_2();
  563. }
  564. o_.oneof_e_2_ = value;
  565. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessage.oneof_e_2)
  566. }
  567. inline bool MyMessage::has_o() const {
  568. return o_case() != O_NOT_SET;
  569. }
  570. inline void MyMessage::clear_has_o() {
  571. _oneof_case_[0] = O_NOT_SET;
  572. }
  573. inline MyMessage::OCase MyMessage::o_case() const {
  574. return MyMessage::OCase(_oneof_case_[0]);
  575. }
  576. // -------------------------------------------------------------------
  577. // MyMessagePlusExtra
  578. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
  579. inline void MyMessagePlusExtra::clear_e() {
  580. e_ = 0;
  581. }
  582. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::e() const {
  583. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.e)
  584. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(e_);
  585. }
  586. inline void MyMessagePlusExtra::set_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  587. e_ = value;
  588. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.e)
  589. }
  590. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
  591. inline int MyMessagePlusExtra::repeated_e_size() const {
  592. return repeated_e_.size();
  593. }
  594. inline void MyMessagePlusExtra::clear_repeated_e() {
  595. repeated_e_.Clear();
  596. }
  597. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::repeated_e(int index) const {
  598. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_e)
  599. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(repeated_e_.Get(index));
  600. }
  601. inline void MyMessagePlusExtra::set_repeated_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  602. repeated_e_.Set(index, value);
  603. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_e)
  604. }
  605. inline void MyMessagePlusExtra::add_repeated_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  606. repeated_e_.Add(value);
  607. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_e)
  608. }
  609. inline const ::google::protobuf::RepeatedField<int>&
  610. MyMessagePlusExtra::repeated_e() const {
  611. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_e)
  612. return repeated_e_;
  613. }
  614. inline ::google::protobuf::RepeatedField<int>*
  615. MyMessagePlusExtra::mutable_repeated_e() {
  616. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_e)
  617. return &repeated_e_;
  618. }
  619. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
  620. inline int MyMessagePlusExtra::repeated_packed_e_size() const {
  621. return repeated_packed_e_.size();
  622. }
  623. inline void MyMessagePlusExtra::clear_repeated_packed_e() {
  624. repeated_packed_e_.Clear();
  625. }
  626. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::repeated_packed_e(int index) const {
  627. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_e)
  628. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(repeated_packed_e_.Get(index));
  629. }
  630. inline void MyMessagePlusExtra::set_repeated_packed_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  631. repeated_packed_e_.Set(index, value);
  632. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_e)
  633. }
  634. inline void MyMessagePlusExtra::add_repeated_packed_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  635. repeated_packed_e_.Add(value);
  636. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_e)
  637. }
  638. inline const ::google::protobuf::RepeatedField<int>&
  639. MyMessagePlusExtra::repeated_packed_e() const {
  640. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_e)
  641. return repeated_packed_e_;
  642. }
  643. inline ::google::protobuf::RepeatedField<int>*
  644. MyMessagePlusExtra::mutable_repeated_packed_e() {
  645. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_e)
  646. return &repeated_packed_e_;
  647. }
  648. // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
  649. inline int MyMessagePlusExtra::repeated_packed_unexpected_e_size() const {
  650. return repeated_packed_unexpected_e_.size();
  651. }
  652. inline void MyMessagePlusExtra::clear_repeated_packed_unexpected_e() {
  653. repeated_packed_unexpected_e_.Clear();
  654. }
  655. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::repeated_packed_unexpected_e(int index) const {
  656. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_unexpected_e)
  657. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(repeated_packed_unexpected_e_.Get(index));
  658. }
  659. inline void MyMessagePlusExtra::set_repeated_packed_unexpected_e(int index, ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  660. repeated_packed_unexpected_e_.Set(index, value);
  661. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_unexpected_e)
  662. }
  663. inline void MyMessagePlusExtra::add_repeated_packed_unexpected_e(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  664. repeated_packed_unexpected_e_.Add(value);
  665. // @@protoc_insertion_point(field_add:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_unexpected_e)
  666. }
  667. inline const ::google::protobuf::RepeatedField<int>&
  668. MyMessagePlusExtra::repeated_packed_unexpected_e() const {
  669. // @@protoc_insertion_point(field_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_unexpected_e)
  670. return repeated_packed_unexpected_e_;
  671. }
  672. inline ::google::protobuf::RepeatedField<int>*
  673. MyMessagePlusExtra::mutable_repeated_packed_unexpected_e() {
  674. // @@protoc_insertion_point(field_mutable_list:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.repeated_packed_unexpected_e)
  675. return &repeated_packed_unexpected_e_;
  676. }
  677. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
  678. inline bool MyMessagePlusExtra::has_oneof_e_1() const {
  679. return o_case() == kOneofE1;
  680. }
  681. inline void MyMessagePlusExtra::set_has_oneof_e_1() {
  682. _oneof_case_[0] = kOneofE1;
  683. }
  684. inline void MyMessagePlusExtra::clear_oneof_e_1() {
  685. if (has_oneof_e_1()) {
  686. o_.oneof_e_1_ = 0;
  687. clear_has_o();
  688. }
  689. }
  690. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::oneof_e_1() const {
  691. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.oneof_e_1)
  692. if (has_oneof_e_1()) {
  693. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(o_.oneof_e_1_);
  694. }
  695. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(0);
  696. }
  697. inline void MyMessagePlusExtra::set_oneof_e_1(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  698. if (!has_oneof_e_1()) {
  699. clear_o();
  700. set_has_oneof_e_1();
  701. }
  702. o_.oneof_e_1_ = value;
  703. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.oneof_e_1)
  704. }
  705. // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
  706. inline bool MyMessagePlusExtra::has_oneof_e_2() const {
  707. return o_case() == kOneofE2;
  708. }
  709. inline void MyMessagePlusExtra::set_has_oneof_e_2() {
  710. _oneof_case_[0] = kOneofE2;
  711. }
  712. inline void MyMessagePlusExtra::clear_oneof_e_2() {
  713. if (has_oneof_e_2()) {
  714. o_.oneof_e_2_ = 0;
  715. clear_has_o();
  716. }
  717. }
  718. inline ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra MyMessagePlusExtra::oneof_e_2() const {
  719. // @@protoc_insertion_point(field_get:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.oneof_e_2)
  720. if (has_oneof_e_2()) {
  721. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(o_.oneof_e_2_);
  722. }
  723. return static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(0);
  724. }
  725. inline void MyMessagePlusExtra::set_oneof_e_2(::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra value) {
  726. if (!has_oneof_e_2()) {
  727. clear_o();
  728. set_has_oneof_e_2();
  729. }
  730. o_.oneof_e_2_ = value;
  731. // @@protoc_insertion_point(field_set:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra.oneof_e_2)
  732. }
  733. inline bool MyMessagePlusExtra::has_o() const {
  734. return o_case() != O_NOT_SET;
  735. }
  736. inline void MyMessagePlusExtra::clear_has_o() {
  737. _oneof_case_[0] = O_NOT_SET;
  738. }
  739. inline MyMessagePlusExtra::OCase MyMessagePlusExtra::o_case() const {
  740. return MyMessagePlusExtra::OCase(_oneof_case_[0]);
  741. }
  742. #ifdef __GNUC__
  743. #pragma GCC diagnostic pop
  744. #endif // __GNUC__
  745. // -------------------------------------------------------------------
  746. // @@protoc_insertion_point(namespace_scope)
  747. } // namespace proto3_preserve_unknown_enum_unittest
  748. namespace google {
  749. namespace protobuf {
  750. template <> struct is_proto_enum< ::proto3_preserve_unknown_enum_unittest::MyEnum> : ::std::true_type {};
  751. template <>
  752. inline const EnumDescriptor* GetEnumDescriptor< ::proto3_preserve_unknown_enum_unittest::MyEnum>() {
  753. return ::proto3_preserve_unknown_enum_unittest::MyEnum_descriptor();
  754. }
  755. template <> struct is_proto_enum< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra> : ::std::true_type {};
  756. template <>
  757. inline const EnumDescriptor* GetEnumDescriptor< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra>() {
  758. return ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra_descriptor();
  759. }
  760. } // namespace protobuf
  761. } // namespace google
  762. // @@protoc_insertion_point(global_scope)
  763. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto