PageRenderTime 24ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

/src/google/protobuf/field_mask.pb.cc

https://gitlab.com/github-cloud-corporation/protobuf
C++ | 402 lines | 307 code | 53 blank | 42 comment | 36 complexity | 30bbe62439628e73c16b1ea857293b00 MD5 | raw file
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/field_mask.proto
  3. #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  4. #include <google/protobuf/field_mask.pb.h>
  5. #include <algorithm>
  6. #include <google/protobuf/stubs/common.h>
  7. #include <google/protobuf/stubs/port.h>
  8. #include <google/protobuf/stubs/once.h>
  9. #include <google/protobuf/io/coded_stream.h>
  10. #include <google/protobuf/wire_format_lite_inl.h>
  11. #include <google/protobuf/descriptor.h>
  12. #include <google/protobuf/generated_message_reflection.h>
  13. #include <google/protobuf/reflection_ops.h>
  14. #include <google/protobuf/wire_format.h>
  15. // @@protoc_insertion_point(includes)
  16. namespace google {
  17. namespace protobuf {
  18. namespace {
  19. const ::google::protobuf::Descriptor* FieldMask_descriptor_ = NULL;
  20. const ::google::protobuf::internal::GeneratedMessageReflection*
  21. FieldMask_reflection_ = NULL;
  22. } // namespace
  23. void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() GOOGLE_ATTRIBUTE_COLD;
  24. void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
  25. protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
  26. const ::google::protobuf::FileDescriptor* file =
  27. ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
  28. "google/protobuf/field_mask.proto");
  29. GOOGLE_CHECK(file != NULL);
  30. FieldMask_descriptor_ = file->message_type(0);
  31. static const int FieldMask_offsets_[1] = {
  32. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_),
  33. };
  34. FieldMask_reflection_ =
  35. ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
  36. FieldMask_descriptor_,
  37. FieldMask::default_instance_,
  38. FieldMask_offsets_,
  39. -1,
  40. -1,
  41. -1,
  42. sizeof(FieldMask),
  43. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_),
  44. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _is_default_instance_));
  45. }
  46. namespace {
  47. GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  48. inline void protobuf_AssignDescriptorsOnce() {
  49. ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
  50. &protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto);
  51. }
  52. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
  53. void protobuf_RegisterTypes(const ::std::string&) {
  54. protobuf_AssignDescriptorsOnce();
  55. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  56. FieldMask_descriptor_, &FieldMask::default_instance());
  57. }
  58. } // namespace
  59. void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto() {
  60. delete FieldMask::default_instance_;
  61. delete FieldMask_reflection_;
  62. }
  63. void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() GOOGLE_ATTRIBUTE_COLD;
  64. void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
  65. static bool already_here = false;
  66. if (already_here) return;
  67. already_here = true;
  68. GOOGLE_PROTOBUF_VERIFY_VERSION;
  69. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  70. "\n google/protobuf/field_mask.proto\022\017goog"
  71. "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
  72. "Q\n\023com.google.protobufB\016FieldMaskProtoP\001"
  73. "\240\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTyp"
  74. "esb\006proto3", 170);
  75. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  76. "google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
  77. FieldMask::default_instance_ = new FieldMask();
  78. FieldMask::default_instance_->InitAsDefaultInstance();
  79. ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto);
  80. }
  81. // Force AddDescriptors() to be called at static initialization time.
  82. struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto {
  83. StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto() {
  84. protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
  85. }
  86. } static_descriptor_initializer_google_2fprotobuf_2ffield_5fmask_2eproto_;
  87. // ===================================================================
  88. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  89. const int FieldMask::kPathsFieldNumber;
  90. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  91. FieldMask::FieldMask()
  92. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  93. SharedCtor();
  94. // @@protoc_insertion_point(constructor:google.protobuf.FieldMask)
  95. }
  96. void FieldMask::InitAsDefaultInstance() {
  97. _is_default_instance_ = true;
  98. }
  99. FieldMask::FieldMask(const FieldMask& from)
  100. : ::google::protobuf::Message(),
  101. _internal_metadata_(NULL) {
  102. SharedCtor();
  103. MergeFrom(from);
  104. // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask)
  105. }
  106. void FieldMask::SharedCtor() {
  107. _is_default_instance_ = false;
  108. ::google::protobuf::internal::GetEmptyString();
  109. _cached_size_ = 0;
  110. }
  111. FieldMask::~FieldMask() {
  112. // @@protoc_insertion_point(destructor:google.protobuf.FieldMask)
  113. SharedDtor();
  114. }
  115. void FieldMask::SharedDtor() {
  116. if (this != default_instance_) {
  117. }
  118. }
  119. void FieldMask::SetCachedSize(int size) const {
  120. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  121. _cached_size_ = size;
  122. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  123. }
  124. const ::google::protobuf::Descriptor* FieldMask::descriptor() {
  125. protobuf_AssignDescriptorsOnce();
  126. return FieldMask_descriptor_;
  127. }
  128. const FieldMask& FieldMask::default_instance() {
  129. if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
  130. return *default_instance_;
  131. }
  132. FieldMask* FieldMask::default_instance_ = NULL;
  133. FieldMask* FieldMask::New(::google::protobuf::Arena* arena) const {
  134. FieldMask* n = new FieldMask;
  135. if (arena != NULL) {
  136. arena->Own(n);
  137. }
  138. return n;
  139. }
  140. void FieldMask::Clear() {
  141. // @@protoc_insertion_point(message_clear_start:google.protobuf.FieldMask)
  142. paths_.Clear();
  143. }
  144. bool FieldMask::MergePartialFromCodedStream(
  145. ::google::protobuf::io::CodedInputStream* input) {
  146. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  147. ::google::protobuf::uint32 tag;
  148. // @@protoc_insertion_point(parse_start:google.protobuf.FieldMask)
  149. for (;;) {
  150. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
  151. tag = p.first;
  152. if (!p.second) goto handle_unusual;
  153. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  154. // repeated string paths = 1;
  155. case 1: {
  156. if (tag == 10) {
  157. parse_paths:
  158. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  159. input, this->add_paths()));
  160. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  161. this->paths(this->paths_size() - 1).data(),
  162. this->paths(this->paths_size() - 1).length(),
  163. ::google::protobuf::internal::WireFormatLite::PARSE,
  164. "google.protobuf.FieldMask.paths"));
  165. } else {
  166. goto handle_unusual;
  167. }
  168. if (input->ExpectTag(10)) goto parse_paths;
  169. if (input->ExpectAtEnd()) goto success;
  170. break;
  171. }
  172. default: {
  173. handle_unusual:
  174. if (tag == 0 ||
  175. ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  176. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  177. goto success;
  178. }
  179. DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  180. break;
  181. }
  182. }
  183. }
  184. success:
  185. // @@protoc_insertion_point(parse_success:google.protobuf.FieldMask)
  186. return true;
  187. failure:
  188. // @@protoc_insertion_point(parse_failure:google.protobuf.FieldMask)
  189. return false;
  190. #undef DO_
  191. }
  192. void FieldMask::SerializeWithCachedSizes(
  193. ::google::protobuf::io::CodedOutputStream* output) const {
  194. // @@protoc_insertion_point(serialize_start:google.protobuf.FieldMask)
  195. // repeated string paths = 1;
  196. for (int i = 0; i < this->paths_size(); i++) {
  197. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  198. this->paths(i).data(), this->paths(i).length(),
  199. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  200. "google.protobuf.FieldMask.paths");
  201. ::google::protobuf::internal::WireFormatLite::WriteString(
  202. 1, this->paths(i), output);
  203. }
  204. // @@protoc_insertion_point(serialize_end:google.protobuf.FieldMask)
  205. }
  206. ::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray(
  207. bool deterministic, ::google::protobuf::uint8* target) const {
  208. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask)
  209. // repeated string paths = 1;
  210. for (int i = 0; i < this->paths_size(); i++) {
  211. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  212. this->paths(i).data(), this->paths(i).length(),
  213. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  214. "google.protobuf.FieldMask.paths");
  215. target = ::google::protobuf::internal::WireFormatLite::
  216. WriteStringToArray(1, this->paths(i), target);
  217. }
  218. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldMask)
  219. return target;
  220. }
  221. int FieldMask::ByteSize() const {
  222. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldMask)
  223. int total_size = 0;
  224. // repeated string paths = 1;
  225. total_size += 1 * this->paths_size();
  226. for (int i = 0; i < this->paths_size(); i++) {
  227. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  228. this->paths(i));
  229. }
  230. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  231. _cached_size_ = total_size;
  232. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  233. return total_size;
  234. }
  235. void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
  236. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldMask)
  237. if (GOOGLE_PREDICT_FALSE(&from == this)) {
  238. ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  239. }
  240. const FieldMask* source =
  241. ::google::protobuf::internal::DynamicCastToGenerated<const FieldMask>(
  242. &from);
  243. if (source == NULL) {
  244. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldMask)
  245. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  246. } else {
  247. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldMask)
  248. MergeFrom(*source);
  249. }
  250. }
  251. void FieldMask::MergeFrom(const FieldMask& from) {
  252. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldMask)
  253. if (GOOGLE_PREDICT_FALSE(&from == this)) {
  254. ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  255. }
  256. paths_.MergeFrom(from.paths_);
  257. }
  258. void FieldMask::CopyFrom(const ::google::protobuf::Message& from) {
  259. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldMask)
  260. if (&from == this) return;
  261. Clear();
  262. MergeFrom(from);
  263. }
  264. void FieldMask::CopyFrom(const FieldMask& from) {
  265. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldMask)
  266. if (&from == this) return;
  267. Clear();
  268. MergeFrom(from);
  269. }
  270. bool FieldMask::IsInitialized() const {
  271. return true;
  272. }
  273. void FieldMask::Swap(FieldMask* other) {
  274. if (other == this) return;
  275. InternalSwap(other);
  276. }
  277. void FieldMask::InternalSwap(FieldMask* other) {
  278. paths_.UnsafeArenaSwap(&other->paths_);
  279. _internal_metadata_.Swap(&other->_internal_metadata_);
  280. std::swap(_cached_size_, other->_cached_size_);
  281. }
  282. ::google::protobuf::Metadata FieldMask::GetMetadata() const {
  283. protobuf_AssignDescriptorsOnce();
  284. ::google::protobuf::Metadata metadata;
  285. metadata.descriptor = FieldMask_descriptor_;
  286. metadata.reflection = FieldMask_reflection_;
  287. return metadata;
  288. }
  289. #if PROTOBUF_INLINE_NOT_IN_HEADERS
  290. // FieldMask
  291. // repeated string paths = 1;
  292. int FieldMask::paths_size() const {
  293. return paths_.size();
  294. }
  295. void FieldMask::clear_paths() {
  296. paths_.Clear();
  297. }
  298. const ::std::string& FieldMask::paths(int index) const {
  299. // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)
  300. return paths_.Get(index);
  301. }
  302. ::std::string* FieldMask::mutable_paths(int index) {
  303. // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths)
  304. return paths_.Mutable(index);
  305. }
  306. void FieldMask::set_paths(int index, const ::std::string& value) {
  307. // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
  308. paths_.Mutable(index)->assign(value);
  309. }
  310. void FieldMask::set_paths(int index, const char* value) {
  311. paths_.Mutable(index)->assign(value);
  312. // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths)
  313. }
  314. void FieldMask::set_paths(int index, const char* value, size_t size) {
  315. paths_.Mutable(index)->assign(
  316. reinterpret_cast<const char*>(value), size);
  317. // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths)
  318. }
  319. ::std::string* FieldMask::add_paths() {
  320. // @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths)
  321. return paths_.Add();
  322. }
  323. void FieldMask::add_paths(const ::std::string& value) {
  324. paths_.Add()->assign(value);
  325. // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)
  326. }
  327. void FieldMask::add_paths(const char* value) {
  328. paths_.Add()->assign(value);
  329. // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths)
  330. }
  331. void FieldMask::add_paths(const char* value, size_t size) {
  332. paths_.Add()->assign(reinterpret_cast<const char*>(value), size);
  333. // @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths)
  334. }
  335. const ::google::protobuf::RepeatedPtrField< ::std::string>&
  336. FieldMask::paths() const {
  337. // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths)
  338. return paths_;
  339. }
  340. ::google::protobuf::RepeatedPtrField< ::std::string>*
  341. FieldMask::mutable_paths() {
  342. // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths)
  343. return &paths_;
  344. }
  345. #endif // PROTOBUF_INLINE_NOT_IN_HEADERS
  346. // @@protoc_insertion_point(namespace_scope)
  347. } // namespace protobuf
  348. } // namespace google
  349. // @@protoc_insertion_point(global_scope)