unittest_preserve_unknown_enum2.pb.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/unittest_preserve_unknown_enum2.proto
  3. #ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum2_2eproto
  4. #define PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum2_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_5fenum2_2eproto
  31. namespace protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum2_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[1];
  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_5fenum2_2eproto
  43. namespace proto2_preserve_unknown_enum_unittest {
  44. class MyMessage;
  45. class MyMessageDefaultTypeInternal;
  46. extern MyMessageDefaultTypeInternal _MyMessage_default_instance_;
  47. } // namespace proto2_preserve_unknown_enum_unittest
  48. namespace google {
  49. namespace protobuf {
  50. template<> ::proto2_preserve_unknown_enum_unittest::MyMessage* Arena::CreateMaybeMessage<::proto2_preserve_unknown_enum_unittest::MyMessage>(Arena*);
  51. } // namespace protobuf
  52. } // namespace google
  53. namespace proto2_preserve_unknown_enum_unittest {
  54. enum MyEnum {
  55. FOO = 0,
  56. BAR = 1,
  57. BAZ = 2
  58. };
  59. bool MyEnum_IsValid(int value);
  60. const MyEnum MyEnum_MIN = FOO;
  61. const MyEnum MyEnum_MAX = BAZ;
  62. const int MyEnum_ARRAYSIZE = MyEnum_MAX + 1;
  63. const ::google::protobuf::EnumDescriptor* MyEnum_descriptor();
  64. inline const ::std::string& MyEnum_Name(MyEnum value) {
  65. return ::google::protobuf::internal::NameOfEnum(
  66. MyEnum_descriptor(), value);
  67. }
  68. inline bool MyEnum_Parse(
  69. const ::std::string& name, MyEnum* value) {
  70. return ::google::protobuf::internal::ParseNamedEnum<MyEnum>(
  71. MyEnum_descriptor(), name, value);
  72. }
  73. // ===================================================================
  74. class MyMessage : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:proto2_preserve_unknown_enum_unittest.MyMessage) */ {
  75. public:
  76. MyMessage();
  77. virtual ~MyMessage();
  78. MyMessage(const MyMessage& from);
  79. inline MyMessage& operator=(const MyMessage& from) {
  80. CopyFrom(from);
  81. return *this;
  82. }
  83. #if LANG_CXX11
  84. MyMessage(MyMessage&& from) noexcept
  85. : MyMessage() {
  86. *this = ::std::move(from);
  87. }
  88. inline MyMessage& operator=(MyMessage&& from) noexcept {
  89. if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
  90. if (this != &from) InternalSwap(&from);
  91. } else {
  92. CopyFrom(from);
  93. }
  94. return *this;
  95. }
  96. #endif
  97. inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
  98. return _internal_metadata_.unknown_fields();
  99. }
  100. inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
  101. return _internal_metadata_.mutable_unknown_fields();
  102. }
  103. static const ::google::protobuf::Descriptor* descriptor();
  104. static const MyMessage& default_instance();
  105. enum OCase {
  106. kOneofE1 = 5,
  107. kOneofE2 = 6,
  108. O_NOT_SET = 0,
  109. };
  110. static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
  111. static inline const MyMessage* internal_default_instance() {
  112. return reinterpret_cast<const MyMessage*>(
  113. &_MyMessage_default_instance_);
  114. }
  115. static constexpr int kIndexInFileMessages =
  116. 0;
  117. void Swap(MyMessage* other);
  118. friend void swap(MyMessage& a, MyMessage& b) {
  119. a.Swap(&b);
  120. }
  121. // implements Message ----------------------------------------------
  122. inline MyMessage* New() const final {
  123. return CreateMaybeMessage<MyMessage>(NULL);
  124. }
  125. MyMessage* New(::google::protobuf::Arena* arena) const final {
  126. return CreateMaybeMessage<MyMessage>(arena);
  127. }
  128. void CopyFrom(const ::google::protobuf::Message& from) final;
  129. void MergeFrom(const ::google::protobuf::Message& from) final;
  130. void CopyFrom(const MyMessage& from);
  131. void MergeFrom(const MyMessage& from);
  132. void Clear() final;
  133. bool IsInitialized() const final;
  134. size_t ByteSizeLong() const final;
  135. bool MergePartialFromCodedStream(
  136. ::google::protobuf::io::CodedInputStream* input) final;
  137. void SerializeWithCachedSizes(
  138. ::google::protobuf::io::CodedOutputStream* output) const final;
  139. ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
  140. bool deterministic, ::google::protobuf::uint8* target) const final;
  141. int GetCachedSize() const final { return _cached_size_.Get(); }
  142. private:
  143. void SharedCtor();
  144. void SharedDtor();
  145. void SetCachedSize(int size) const final;
  146. void InternalSwap(MyMessage* other);
  147. private:
  148. inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
  149. return NULL;
  150. }
  151. inline void* MaybeArenaPtr() const {
  152. return NULL;
  153. }
  154. public:
  155. ::google::protobuf::Metadata GetMetadata() const final;
  156. // nested types ----------------------------------------------------
  157. // accessors -------------------------------------------------------
  158. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
  159. int repeated_e_size() const;
  160. void clear_repeated_e();
  161. static const int kRepeatedEFieldNumber = 2;
  162. ::proto2_preserve_unknown_enum_unittest::MyEnum repeated_e(int index) const;
  163. void set_repeated_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value);
  164. void add_repeated_e(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  165. const ::google::protobuf::RepeatedField<int>& repeated_e() const;
  166. ::google::protobuf::RepeatedField<int>* mutable_repeated_e();
  167. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
  168. int repeated_packed_e_size() const;
  169. void clear_repeated_packed_e();
  170. static const int kRepeatedPackedEFieldNumber = 3;
  171. ::proto2_preserve_unknown_enum_unittest::MyEnum repeated_packed_e(int index) const;
  172. void set_repeated_packed_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value);
  173. void add_repeated_packed_e(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  174. const ::google::protobuf::RepeatedField<int>& repeated_packed_e() const;
  175. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_e();
  176. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_packed_unexpected_e = 4;
  177. int repeated_packed_unexpected_e_size() const;
  178. void clear_repeated_packed_unexpected_e();
  179. static const int kRepeatedPackedUnexpectedEFieldNumber = 4;
  180. ::proto2_preserve_unknown_enum_unittest::MyEnum repeated_packed_unexpected_e(int index) const;
  181. void set_repeated_packed_unexpected_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value);
  182. void add_repeated_packed_unexpected_e(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  183. const ::google::protobuf::RepeatedField<int>& repeated_packed_unexpected_e() const;
  184. ::google::protobuf::RepeatedField<int>* mutable_repeated_packed_unexpected_e();
  185. // optional .proto2_preserve_unknown_enum_unittest.MyEnum e = 1;
  186. bool has_e() const;
  187. void clear_e();
  188. static const int kEFieldNumber = 1;
  189. ::proto2_preserve_unknown_enum_unittest::MyEnum e() const;
  190. void set_e(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  191. // optional .proto2_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
  192. bool has_oneof_e_1() const;
  193. void clear_oneof_e_1();
  194. static const int kOneofE1FieldNumber = 5;
  195. ::proto2_preserve_unknown_enum_unittest::MyEnum oneof_e_1() const;
  196. void set_oneof_e_1(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  197. // optional .proto2_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
  198. bool has_oneof_e_2() const;
  199. void clear_oneof_e_2();
  200. static const int kOneofE2FieldNumber = 6;
  201. ::proto2_preserve_unknown_enum_unittest::MyEnum oneof_e_2() const;
  202. void set_oneof_e_2(::proto2_preserve_unknown_enum_unittest::MyEnum value);
  203. void clear_o();
  204. OCase o_case() const;
  205. // @@protoc_insertion_point(class_scope:proto2_preserve_unknown_enum_unittest.MyMessage)
  206. private:
  207. void set_has_e();
  208. void clear_has_e();
  209. void set_has_oneof_e_1();
  210. void set_has_oneof_e_2();
  211. inline bool has_o() const;
  212. inline void clear_has_o();
  213. ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  214. ::google::protobuf::internal::HasBits<1> _has_bits_;
  215. mutable ::google::protobuf::internal::CachedSize _cached_size_;
  216. ::google::protobuf::RepeatedField<int> repeated_e_;
  217. ::google::protobuf::RepeatedField<int> repeated_packed_e_;
  218. mutable int _repeated_packed_e_cached_byte_size_;
  219. ::google::protobuf::RepeatedField<int> repeated_packed_unexpected_e_;
  220. int e_;
  221. union OUnion {
  222. OUnion() {}
  223. int oneof_e_1_;
  224. int oneof_e_2_;
  225. } o_;
  226. ::google::protobuf::uint32 _oneof_case_[1];
  227. friend struct ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum2_2eproto::TableStruct;
  228. };
  229. // ===================================================================
  230. // ===================================================================
  231. #ifdef __GNUC__
  232. #pragma GCC diagnostic push
  233. #pragma GCC diagnostic ignored "-Wstrict-aliasing"
  234. #endif // __GNUC__
  235. // MyMessage
  236. // optional .proto2_preserve_unknown_enum_unittest.MyEnum e = 1;
  237. inline bool MyMessage::has_e() const {
  238. return (_has_bits_[0] & 0x00000001u) != 0;
  239. }
  240. inline void MyMessage::set_has_e() {
  241. _has_bits_[0] |= 0x00000001u;
  242. }
  243. inline void MyMessage::clear_has_e() {
  244. _has_bits_[0] &= ~0x00000001u;
  245. }
  246. inline void MyMessage::clear_e() {
  247. e_ = 0;
  248. clear_has_e();
  249. }
  250. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::e() const {
  251. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.e)
  252. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(e_);
  253. }
  254. inline void MyMessage::set_e(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  255. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  256. set_has_e();
  257. e_ = value;
  258. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.e)
  259. }
  260. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
  261. inline int MyMessage::repeated_e_size() const {
  262. return repeated_e_.size();
  263. }
  264. inline void MyMessage::clear_repeated_e() {
  265. repeated_e_.Clear();
  266. }
  267. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::repeated_e(int index) const {
  268. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  269. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(repeated_e_.Get(index));
  270. }
  271. inline void MyMessage::set_repeated_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  272. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  273. repeated_e_.Set(index, value);
  274. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  275. }
  276. inline void MyMessage::add_repeated_e(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  277. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  278. repeated_e_.Add(value);
  279. // @@protoc_insertion_point(field_add:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  280. }
  281. inline const ::google::protobuf::RepeatedField<int>&
  282. MyMessage::repeated_e() const {
  283. // @@protoc_insertion_point(field_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  284. return repeated_e_;
  285. }
  286. inline ::google::protobuf::RepeatedField<int>*
  287. MyMessage::mutable_repeated_e() {
  288. // @@protoc_insertion_point(field_mutable_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_e)
  289. return &repeated_e_;
  290. }
  291. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
  292. inline int MyMessage::repeated_packed_e_size() const {
  293. return repeated_packed_e_.size();
  294. }
  295. inline void MyMessage::clear_repeated_packed_e() {
  296. repeated_packed_e_.Clear();
  297. }
  298. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::repeated_packed_e(int index) const {
  299. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  300. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(repeated_packed_e_.Get(index));
  301. }
  302. inline void MyMessage::set_repeated_packed_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  303. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  304. repeated_packed_e_.Set(index, value);
  305. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  306. }
  307. inline void MyMessage::add_repeated_packed_e(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  308. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  309. repeated_packed_e_.Add(value);
  310. // @@protoc_insertion_point(field_add:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  311. }
  312. inline const ::google::protobuf::RepeatedField<int>&
  313. MyMessage::repeated_packed_e() const {
  314. // @@protoc_insertion_point(field_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  315. return repeated_packed_e_;
  316. }
  317. inline ::google::protobuf::RepeatedField<int>*
  318. MyMessage::mutable_repeated_packed_e() {
  319. // @@protoc_insertion_point(field_mutable_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_e)
  320. return &repeated_packed_e_;
  321. }
  322. // repeated .proto2_preserve_unknown_enum_unittest.MyEnum repeated_packed_unexpected_e = 4;
  323. inline int MyMessage::repeated_packed_unexpected_e_size() const {
  324. return repeated_packed_unexpected_e_.size();
  325. }
  326. inline void MyMessage::clear_repeated_packed_unexpected_e() {
  327. repeated_packed_unexpected_e_.Clear();
  328. }
  329. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::repeated_packed_unexpected_e(int index) const {
  330. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  331. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(repeated_packed_unexpected_e_.Get(index));
  332. }
  333. inline void MyMessage::set_repeated_packed_unexpected_e(int index, ::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  334. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  335. repeated_packed_unexpected_e_.Set(index, value);
  336. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  337. }
  338. inline void MyMessage::add_repeated_packed_unexpected_e(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  339. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  340. repeated_packed_unexpected_e_.Add(value);
  341. // @@protoc_insertion_point(field_add:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  342. }
  343. inline const ::google::protobuf::RepeatedField<int>&
  344. MyMessage::repeated_packed_unexpected_e() const {
  345. // @@protoc_insertion_point(field_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  346. return repeated_packed_unexpected_e_;
  347. }
  348. inline ::google::protobuf::RepeatedField<int>*
  349. MyMessage::mutable_repeated_packed_unexpected_e() {
  350. // @@protoc_insertion_point(field_mutable_list:proto2_preserve_unknown_enum_unittest.MyMessage.repeated_packed_unexpected_e)
  351. return &repeated_packed_unexpected_e_;
  352. }
  353. // optional .proto2_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
  354. inline bool MyMessage::has_oneof_e_1() const {
  355. return o_case() == kOneofE1;
  356. }
  357. inline void MyMessage::set_has_oneof_e_1() {
  358. _oneof_case_[0] = kOneofE1;
  359. }
  360. inline void MyMessage::clear_oneof_e_1() {
  361. if (has_oneof_e_1()) {
  362. o_.oneof_e_1_ = 0;
  363. clear_has_o();
  364. }
  365. }
  366. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::oneof_e_1() const {
  367. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.oneof_e_1)
  368. if (has_oneof_e_1()) {
  369. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(o_.oneof_e_1_);
  370. }
  371. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(0);
  372. }
  373. inline void MyMessage::set_oneof_e_1(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  374. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  375. if (!has_oneof_e_1()) {
  376. clear_o();
  377. set_has_oneof_e_1();
  378. }
  379. o_.oneof_e_1_ = value;
  380. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.oneof_e_1)
  381. }
  382. // optional .proto2_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
  383. inline bool MyMessage::has_oneof_e_2() const {
  384. return o_case() == kOneofE2;
  385. }
  386. inline void MyMessage::set_has_oneof_e_2() {
  387. _oneof_case_[0] = kOneofE2;
  388. }
  389. inline void MyMessage::clear_oneof_e_2() {
  390. if (has_oneof_e_2()) {
  391. o_.oneof_e_2_ = 0;
  392. clear_has_o();
  393. }
  394. }
  395. inline ::proto2_preserve_unknown_enum_unittest::MyEnum MyMessage::oneof_e_2() const {
  396. // @@protoc_insertion_point(field_get:proto2_preserve_unknown_enum_unittest.MyMessage.oneof_e_2)
  397. if (has_oneof_e_2()) {
  398. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(o_.oneof_e_2_);
  399. }
  400. return static_cast< ::proto2_preserve_unknown_enum_unittest::MyEnum >(0);
  401. }
  402. inline void MyMessage::set_oneof_e_2(::proto2_preserve_unknown_enum_unittest::MyEnum value) {
  403. assert(::proto2_preserve_unknown_enum_unittest::MyEnum_IsValid(value));
  404. if (!has_oneof_e_2()) {
  405. clear_o();
  406. set_has_oneof_e_2();
  407. }
  408. o_.oneof_e_2_ = value;
  409. // @@protoc_insertion_point(field_set:proto2_preserve_unknown_enum_unittest.MyMessage.oneof_e_2)
  410. }
  411. inline bool MyMessage::has_o() const {
  412. return o_case() != O_NOT_SET;
  413. }
  414. inline void MyMessage::clear_has_o() {
  415. _oneof_case_[0] = O_NOT_SET;
  416. }
  417. inline MyMessage::OCase MyMessage::o_case() const {
  418. return MyMessage::OCase(_oneof_case_[0]);
  419. }
  420. #ifdef __GNUC__
  421. #pragma GCC diagnostic pop
  422. #endif // __GNUC__
  423. // @@protoc_insertion_point(namespace_scope)
  424. } // namespace proto2_preserve_unknown_enum_unittest
  425. namespace google {
  426. namespace protobuf {
  427. template <> struct is_proto_enum< ::proto2_preserve_unknown_enum_unittest::MyEnum> : ::std::true_type {};
  428. template <>
  429. inline const EnumDescriptor* GetEnumDescriptor< ::proto2_preserve_unknown_enum_unittest::MyEnum>() {
  430. return ::proto2_preserve_unknown_enum_unittest::MyEnum_descriptor();
  431. }
  432. } // namespace protobuf
  433. } // namespace google
  434. // @@protoc_insertion_point(global_scope)
  435. #endif // PROTOBUF_INCLUDED_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum2_2eproto