map.pb.cc 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: map.proto
  3. #include "map.pb.h"
  4. #include <algorithm>
  5. #include <google/protobuf/io/coded_stream.h>
  6. #include <google/protobuf/extension_set.h>
  7. #include <google/protobuf/wire_format_lite.h>
  8. #include <google/protobuf/descriptor.h>
  9. #include <google/protobuf/generated_message_reflection.h>
  10. #include <google/protobuf/reflection_ops.h>
  11. #include <google/protobuf/wire_format.h>
  12. // @@protoc_insertion_point(includes)
  13. #include <google/protobuf/port_def.inc>
  14. extern PROTOBUF_INTERNAL_EXPORT_map_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Edge_map_2eproto;
  15. extern PROTOBUF_INTERNAL_EXPORT_map_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Node_map_2eproto;
  16. namespace MapMessage {
  17. class NodeDefaultTypeInternal {
  18. public:
  19. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Node> _instance;
  20. } _Node_default_instance_;
  21. class EdgeDefaultTypeInternal {
  22. public:
  23. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Edge> _instance;
  24. } _Edge_default_instance_;
  25. class MapDefaultTypeInternal {
  26. public:
  27. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Map> _instance;
  28. } _Map_default_instance_;
  29. } // namespace MapMessage
  30. static void InitDefaultsscc_info_Edge_map_2eproto() {
  31. GOOGLE_PROTOBUF_VERIFY_VERSION;
  32. {
  33. void* ptr = &::MapMessage::_Edge_default_instance_;
  34. new (ptr) ::MapMessage::Edge();
  35. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  36. }
  37. ::MapMessage::Edge::InitAsDefaultInstance();
  38. }
  39. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Edge_map_2eproto =
  40. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Edge_map_2eproto}, {}};
  41. static void InitDefaultsscc_info_Map_map_2eproto() {
  42. GOOGLE_PROTOBUF_VERIFY_VERSION;
  43. {
  44. void* ptr = &::MapMessage::_Map_default_instance_;
  45. new (ptr) ::MapMessage::Map();
  46. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  47. }
  48. ::MapMessage::Map::InitAsDefaultInstance();
  49. }
  50. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Map_map_2eproto =
  51. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_Map_map_2eproto}, {
  52. &scc_info_Node_map_2eproto.base,
  53. &scc_info_Edge_map_2eproto.base,}};
  54. static void InitDefaultsscc_info_Node_map_2eproto() {
  55. GOOGLE_PROTOBUF_VERIFY_VERSION;
  56. {
  57. void* ptr = &::MapMessage::_Node_default_instance_;
  58. new (ptr) ::MapMessage::Node();
  59. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  60. }
  61. ::MapMessage::Node::InitAsDefaultInstance();
  62. }
  63. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Node_map_2eproto =
  64. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Node_map_2eproto}, {}};
  65. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_map_2eproto[3];
  66. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_map_2eproto = nullptr;
  67. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_map_2eproto = nullptr;
  68. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_map_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  69. ~0u, // no _has_bits_
  70. PROTOBUF_FIELD_OFFSET(::MapMessage::Node, _internal_metadata_),
  71. ~0u, // no _extensions_
  72. ~0u, // no _oneof_case_
  73. ~0u, // no _weak_field_map_
  74. PROTOBUF_FIELD_OFFSET(::MapMessage::Node, id_),
  75. PROTOBUF_FIELD_OFFSET(::MapMessage::Node, x_),
  76. PROTOBUF_FIELD_OFFSET(::MapMessage::Node, y_),
  77. ~0u, // no _has_bits_
  78. PROTOBUF_FIELD_OFFSET(::MapMessage::Edge, _internal_metadata_),
  79. ~0u, // no _extensions_
  80. ~0u, // no _oneof_case_
  81. ~0u, // no _weak_field_map_
  82. PROTOBUF_FIELD_OFFSET(::MapMessage::Edge, id1_),
  83. PROTOBUF_FIELD_OFFSET(::MapMessage::Edge, id2_),
  84. PROTOBUF_FIELD_OFFSET(::MapMessage::Edge, directed_),
  85. ~0u, // no _has_bits_
  86. PROTOBUF_FIELD_OFFSET(::MapMessage::Map, _internal_metadata_),
  87. ~0u, // no _extensions_
  88. ~0u, // no _oneof_case_
  89. ~0u, // no _weak_field_map_
  90. PROTOBUF_FIELD_OFFSET(::MapMessage::Map, nodes_),
  91. PROTOBUF_FIELD_OFFSET(::MapMessage::Map, edges_),
  92. };
  93. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  94. { 0, -1, sizeof(::MapMessage::Node)},
  95. { 8, -1, sizeof(::MapMessage::Edge)},
  96. { 16, -1, sizeof(::MapMessage::Map)},
  97. };
  98. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  99. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MapMessage::_Node_default_instance_),
  100. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MapMessage::_Edge_default_instance_),
  101. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MapMessage::_Map_default_instance_),
  102. };
  103. const char descriptor_table_protodef_map_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  104. "\n\tmap.proto\022\nMapMessage\"(\n\004Node\022\n\n\002id\030\001 "
  105. "\001(\005\022\t\n\001x\030\002 \001(\002\022\t\n\001y\030\003 \001(\002\"2\n\004Edge\022\013\n\003id1"
  106. "\030\001 \001(\005\022\013\n\003id2\030\002 \001(\005\022\020\n\010directed\030\003 \001(\010\"G\n"
  107. "\003Map\022\037\n\005nodes\030\001 \003(\0132\020.MapMessage.Node\022\037\n"
  108. "\005edges\030\002 \003(\0132\020.MapMessage.Edgeb\006proto3"
  109. ;
  110. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_map_2eproto_deps[1] = {
  111. };
  112. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_map_2eproto_sccs[3] = {
  113. &scc_info_Edge_map_2eproto.base,
  114. &scc_info_Map_map_2eproto.base,
  115. &scc_info_Node_map_2eproto.base,
  116. };
  117. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_map_2eproto_once;
  118. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_map_2eproto = {
  119. false, false, descriptor_table_protodef_map_2eproto, "map.proto", 198,
  120. &descriptor_table_map_2eproto_once, descriptor_table_map_2eproto_sccs, descriptor_table_map_2eproto_deps, 3, 0,
  121. schemas, file_default_instances, TableStruct_map_2eproto::offsets,
  122. file_level_metadata_map_2eproto, 3, file_level_enum_descriptors_map_2eproto, file_level_service_descriptors_map_2eproto,
  123. };
  124. // Force running AddDescriptors() at dynamic initialization time.
  125. static bool dynamic_init_dummy_map_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_map_2eproto)), true);
  126. namespace MapMessage {
  127. // ===================================================================
  128. void Node::InitAsDefaultInstance() {
  129. }
  130. class Node::_Internal {
  131. public:
  132. };
  133. Node::Node(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  134. : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
  135. SharedCtor();
  136. RegisterArenaDtor(arena);
  137. // @@protoc_insertion_point(arena_constructor:MapMessage.Node)
  138. }
  139. Node::Node(const Node& from)
  140. : ::PROTOBUF_NAMESPACE_ID::Message() {
  141. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  142. ::memcpy(&id_, &from.id_,
  143. static_cast<size_t>(reinterpret_cast<char*>(&y_) -
  144. reinterpret_cast<char*>(&id_)) + sizeof(y_));
  145. // @@protoc_insertion_point(copy_constructor:MapMessage.Node)
  146. }
  147. void Node::SharedCtor() {
  148. ::memset(&id_, 0, static_cast<size_t>(
  149. reinterpret_cast<char*>(&y_) -
  150. reinterpret_cast<char*>(&id_)) + sizeof(y_));
  151. }
  152. Node::~Node() {
  153. // @@protoc_insertion_point(destructor:MapMessage.Node)
  154. SharedDtor();
  155. _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  156. }
  157. void Node::SharedDtor() {
  158. GOOGLE_DCHECK(GetArena() == nullptr);
  159. }
  160. void Node::ArenaDtor(void* object) {
  161. Node* _this = reinterpret_cast< Node* >(object);
  162. (void)_this;
  163. }
  164. void Node::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  165. }
  166. void Node::SetCachedSize(int size) const {
  167. _cached_size_.Set(size);
  168. }
  169. const Node& Node::default_instance() {
  170. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Node_map_2eproto.base);
  171. return *internal_default_instance();
  172. }
  173. void Node::Clear() {
  174. // @@protoc_insertion_point(message_clear_start:MapMessage.Node)
  175. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  176. // Prevent compiler warnings about cached_has_bits being unused
  177. (void) cached_has_bits;
  178. ::memset(&id_, 0, static_cast<size_t>(
  179. reinterpret_cast<char*>(&y_) -
  180. reinterpret_cast<char*>(&id_)) + sizeof(y_));
  181. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  182. }
  183. const char* Node::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  184. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  185. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  186. while (!ctx->Done(&ptr)) {
  187. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  188. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  189. CHK_(ptr);
  190. switch (tag >> 3) {
  191. // int32 id = 1;
  192. case 1:
  193. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  194. id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  195. CHK_(ptr);
  196. } else goto handle_unusual;
  197. continue;
  198. // float x = 2;
  199. case 2:
  200. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) {
  201. x_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
  202. ptr += sizeof(float);
  203. } else goto handle_unusual;
  204. continue;
  205. // float y = 3;
  206. case 3:
  207. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
  208. y_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
  209. ptr += sizeof(float);
  210. } else goto handle_unusual;
  211. continue;
  212. default: {
  213. handle_unusual:
  214. if ((tag & 7) == 4 || tag == 0) {
  215. ctx->SetLastTag(tag);
  216. goto success;
  217. }
  218. ptr = UnknownFieldParse(tag,
  219. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  220. ptr, ctx);
  221. CHK_(ptr != nullptr);
  222. continue;
  223. }
  224. } // switch
  225. } // while
  226. success:
  227. return ptr;
  228. failure:
  229. ptr = nullptr;
  230. goto success;
  231. #undef CHK_
  232. }
  233. ::PROTOBUF_NAMESPACE_ID::uint8* Node::_InternalSerialize(
  234. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  235. // @@protoc_insertion_point(serialize_to_array_start:MapMessage.Node)
  236. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  237. (void) cached_has_bits;
  238. // int32 id = 1;
  239. if (this->id() != 0) {
  240. target = stream->EnsureSpace(target);
  241. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target);
  242. }
  243. // float x = 2;
  244. if (!(this->x() <= 0 && this->x() >= 0)) {
  245. target = stream->EnsureSpace(target);
  246. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_x(), target);
  247. }
  248. // float y = 3;
  249. if (!(this->y() <= 0 && this->y() >= 0)) {
  250. target = stream->EnsureSpace(target);
  251. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_y(), target);
  252. }
  253. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  254. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  255. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  256. }
  257. // @@protoc_insertion_point(serialize_to_array_end:MapMessage.Node)
  258. return target;
  259. }
  260. size_t Node::ByteSizeLong() const {
  261. // @@protoc_insertion_point(message_byte_size_start:MapMessage.Node)
  262. size_t total_size = 0;
  263. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  264. // Prevent compiler warnings about cached_has_bits being unused
  265. (void) cached_has_bits;
  266. // int32 id = 1;
  267. if (this->id() != 0) {
  268. total_size += 1 +
  269. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  270. this->_internal_id());
  271. }
  272. // float x = 2;
  273. if (!(this->x() <= 0 && this->x() >= 0)) {
  274. total_size += 1 + 4;
  275. }
  276. // float y = 3;
  277. if (!(this->y() <= 0 && this->y() >= 0)) {
  278. total_size += 1 + 4;
  279. }
  280. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  281. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  282. _internal_metadata_, total_size, &_cached_size_);
  283. }
  284. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  285. SetCachedSize(cached_size);
  286. return total_size;
  287. }
  288. void Node::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  289. // @@protoc_insertion_point(generalized_merge_from_start:MapMessage.Node)
  290. GOOGLE_DCHECK_NE(&from, this);
  291. const Node* source =
  292. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Node>(
  293. &from);
  294. if (source == nullptr) {
  295. // @@protoc_insertion_point(generalized_merge_from_cast_fail:MapMessage.Node)
  296. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  297. } else {
  298. // @@protoc_insertion_point(generalized_merge_from_cast_success:MapMessage.Node)
  299. MergeFrom(*source);
  300. }
  301. }
  302. void Node::MergeFrom(const Node& from) {
  303. // @@protoc_insertion_point(class_specific_merge_from_start:MapMessage.Node)
  304. GOOGLE_DCHECK_NE(&from, this);
  305. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  306. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  307. (void) cached_has_bits;
  308. if (from.id() != 0) {
  309. _internal_set_id(from._internal_id());
  310. }
  311. if (!(from.x() <= 0 && from.x() >= 0)) {
  312. _internal_set_x(from._internal_x());
  313. }
  314. if (!(from.y() <= 0 && from.y() >= 0)) {
  315. _internal_set_y(from._internal_y());
  316. }
  317. }
  318. void Node::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  319. // @@protoc_insertion_point(generalized_copy_from_start:MapMessage.Node)
  320. if (&from == this) return;
  321. Clear();
  322. MergeFrom(from);
  323. }
  324. void Node::CopyFrom(const Node& from) {
  325. // @@protoc_insertion_point(class_specific_copy_from_start:MapMessage.Node)
  326. if (&from == this) return;
  327. Clear();
  328. MergeFrom(from);
  329. }
  330. bool Node::IsInitialized() const {
  331. return true;
  332. }
  333. void Node::InternalSwap(Node* other) {
  334. using std::swap;
  335. _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  336. ::PROTOBUF_NAMESPACE_ID::internal::memswap<
  337. PROTOBUF_FIELD_OFFSET(Node, y_)
  338. + sizeof(Node::y_)
  339. - PROTOBUF_FIELD_OFFSET(Node, id_)>(
  340. reinterpret_cast<char*>(&id_),
  341. reinterpret_cast<char*>(&other->id_));
  342. }
  343. ::PROTOBUF_NAMESPACE_ID::Metadata Node::GetMetadata() const {
  344. return GetMetadataStatic();
  345. }
  346. // ===================================================================
  347. void Edge::InitAsDefaultInstance() {
  348. }
  349. class Edge::_Internal {
  350. public:
  351. };
  352. Edge::Edge(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  353. : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
  354. SharedCtor();
  355. RegisterArenaDtor(arena);
  356. // @@protoc_insertion_point(arena_constructor:MapMessage.Edge)
  357. }
  358. Edge::Edge(const Edge& from)
  359. : ::PROTOBUF_NAMESPACE_ID::Message() {
  360. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  361. ::memcpy(&id1_, &from.id1_,
  362. static_cast<size_t>(reinterpret_cast<char*>(&directed_) -
  363. reinterpret_cast<char*>(&id1_)) + sizeof(directed_));
  364. // @@protoc_insertion_point(copy_constructor:MapMessage.Edge)
  365. }
  366. void Edge::SharedCtor() {
  367. ::memset(&id1_, 0, static_cast<size_t>(
  368. reinterpret_cast<char*>(&directed_) -
  369. reinterpret_cast<char*>(&id1_)) + sizeof(directed_));
  370. }
  371. Edge::~Edge() {
  372. // @@protoc_insertion_point(destructor:MapMessage.Edge)
  373. SharedDtor();
  374. _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  375. }
  376. void Edge::SharedDtor() {
  377. GOOGLE_DCHECK(GetArena() == nullptr);
  378. }
  379. void Edge::ArenaDtor(void* object) {
  380. Edge* _this = reinterpret_cast< Edge* >(object);
  381. (void)_this;
  382. }
  383. void Edge::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  384. }
  385. void Edge::SetCachedSize(int size) const {
  386. _cached_size_.Set(size);
  387. }
  388. const Edge& Edge::default_instance() {
  389. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Edge_map_2eproto.base);
  390. return *internal_default_instance();
  391. }
  392. void Edge::Clear() {
  393. // @@protoc_insertion_point(message_clear_start:MapMessage.Edge)
  394. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  395. // Prevent compiler warnings about cached_has_bits being unused
  396. (void) cached_has_bits;
  397. ::memset(&id1_, 0, static_cast<size_t>(
  398. reinterpret_cast<char*>(&directed_) -
  399. reinterpret_cast<char*>(&id1_)) + sizeof(directed_));
  400. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  401. }
  402. const char* Edge::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  403. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  404. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  405. while (!ctx->Done(&ptr)) {
  406. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  407. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  408. CHK_(ptr);
  409. switch (tag >> 3) {
  410. // int32 id1 = 1;
  411. case 1:
  412. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  413. id1_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  414. CHK_(ptr);
  415. } else goto handle_unusual;
  416. continue;
  417. // int32 id2 = 2;
  418. case 2:
  419. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
  420. id2_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  421. CHK_(ptr);
  422. } else goto handle_unusual;
  423. continue;
  424. // bool directed = 3;
  425. case 3:
  426. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
  427. directed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  428. CHK_(ptr);
  429. } else goto handle_unusual;
  430. continue;
  431. default: {
  432. handle_unusual:
  433. if ((tag & 7) == 4 || tag == 0) {
  434. ctx->SetLastTag(tag);
  435. goto success;
  436. }
  437. ptr = UnknownFieldParse(tag,
  438. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  439. ptr, ctx);
  440. CHK_(ptr != nullptr);
  441. continue;
  442. }
  443. } // switch
  444. } // while
  445. success:
  446. return ptr;
  447. failure:
  448. ptr = nullptr;
  449. goto success;
  450. #undef CHK_
  451. }
  452. ::PROTOBUF_NAMESPACE_ID::uint8* Edge::_InternalSerialize(
  453. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  454. // @@protoc_insertion_point(serialize_to_array_start:MapMessage.Edge)
  455. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  456. (void) cached_has_bits;
  457. // int32 id1 = 1;
  458. if (this->id1() != 0) {
  459. target = stream->EnsureSpace(target);
  460. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_id1(), target);
  461. }
  462. // int32 id2 = 2;
  463. if (this->id2() != 0) {
  464. target = stream->EnsureSpace(target);
  465. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_id2(), target);
  466. }
  467. // bool directed = 3;
  468. if (this->directed() != 0) {
  469. target = stream->EnsureSpace(target);
  470. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_directed(), target);
  471. }
  472. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  473. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  474. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  475. }
  476. // @@protoc_insertion_point(serialize_to_array_end:MapMessage.Edge)
  477. return target;
  478. }
  479. size_t Edge::ByteSizeLong() const {
  480. // @@protoc_insertion_point(message_byte_size_start:MapMessage.Edge)
  481. size_t total_size = 0;
  482. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  483. // Prevent compiler warnings about cached_has_bits being unused
  484. (void) cached_has_bits;
  485. // int32 id1 = 1;
  486. if (this->id1() != 0) {
  487. total_size += 1 +
  488. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  489. this->_internal_id1());
  490. }
  491. // int32 id2 = 2;
  492. if (this->id2() != 0) {
  493. total_size += 1 +
  494. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  495. this->_internal_id2());
  496. }
  497. // bool directed = 3;
  498. if (this->directed() != 0) {
  499. total_size += 1 + 1;
  500. }
  501. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  502. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  503. _internal_metadata_, total_size, &_cached_size_);
  504. }
  505. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  506. SetCachedSize(cached_size);
  507. return total_size;
  508. }
  509. void Edge::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  510. // @@protoc_insertion_point(generalized_merge_from_start:MapMessage.Edge)
  511. GOOGLE_DCHECK_NE(&from, this);
  512. const Edge* source =
  513. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Edge>(
  514. &from);
  515. if (source == nullptr) {
  516. // @@protoc_insertion_point(generalized_merge_from_cast_fail:MapMessage.Edge)
  517. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  518. } else {
  519. // @@protoc_insertion_point(generalized_merge_from_cast_success:MapMessage.Edge)
  520. MergeFrom(*source);
  521. }
  522. }
  523. void Edge::MergeFrom(const Edge& from) {
  524. // @@protoc_insertion_point(class_specific_merge_from_start:MapMessage.Edge)
  525. GOOGLE_DCHECK_NE(&from, this);
  526. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  527. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  528. (void) cached_has_bits;
  529. if (from.id1() != 0) {
  530. _internal_set_id1(from._internal_id1());
  531. }
  532. if (from.id2() != 0) {
  533. _internal_set_id2(from._internal_id2());
  534. }
  535. if (from.directed() != 0) {
  536. _internal_set_directed(from._internal_directed());
  537. }
  538. }
  539. void Edge::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  540. // @@protoc_insertion_point(generalized_copy_from_start:MapMessage.Edge)
  541. if (&from == this) return;
  542. Clear();
  543. MergeFrom(from);
  544. }
  545. void Edge::CopyFrom(const Edge& from) {
  546. // @@protoc_insertion_point(class_specific_copy_from_start:MapMessage.Edge)
  547. if (&from == this) return;
  548. Clear();
  549. MergeFrom(from);
  550. }
  551. bool Edge::IsInitialized() const {
  552. return true;
  553. }
  554. void Edge::InternalSwap(Edge* other) {
  555. using std::swap;
  556. _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  557. ::PROTOBUF_NAMESPACE_ID::internal::memswap<
  558. PROTOBUF_FIELD_OFFSET(Edge, directed_)
  559. + sizeof(Edge::directed_)
  560. - PROTOBUF_FIELD_OFFSET(Edge, id1_)>(
  561. reinterpret_cast<char*>(&id1_),
  562. reinterpret_cast<char*>(&other->id1_));
  563. }
  564. ::PROTOBUF_NAMESPACE_ID::Metadata Edge::GetMetadata() const {
  565. return GetMetadataStatic();
  566. }
  567. // ===================================================================
  568. void Map::InitAsDefaultInstance() {
  569. }
  570. class Map::_Internal {
  571. public:
  572. };
  573. Map::Map(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  574. : ::PROTOBUF_NAMESPACE_ID::Message(arena),
  575. nodes_(arena),
  576. edges_(arena) {
  577. SharedCtor();
  578. RegisterArenaDtor(arena);
  579. // @@protoc_insertion_point(arena_constructor:MapMessage.Map)
  580. }
  581. Map::Map(const Map& from)
  582. : ::PROTOBUF_NAMESPACE_ID::Message(),
  583. nodes_(from.nodes_),
  584. edges_(from.edges_) {
  585. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  586. // @@protoc_insertion_point(copy_constructor:MapMessage.Map)
  587. }
  588. void Map::SharedCtor() {
  589. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Map_map_2eproto.base);
  590. }
  591. Map::~Map() {
  592. // @@protoc_insertion_point(destructor:MapMessage.Map)
  593. SharedDtor();
  594. _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  595. }
  596. void Map::SharedDtor() {
  597. GOOGLE_DCHECK(GetArena() == nullptr);
  598. }
  599. void Map::ArenaDtor(void* object) {
  600. Map* _this = reinterpret_cast< Map* >(object);
  601. (void)_this;
  602. }
  603. void Map::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  604. }
  605. void Map::SetCachedSize(int size) const {
  606. _cached_size_.Set(size);
  607. }
  608. const Map& Map::default_instance() {
  609. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Map_map_2eproto.base);
  610. return *internal_default_instance();
  611. }
  612. void Map::Clear() {
  613. // @@protoc_insertion_point(message_clear_start:MapMessage.Map)
  614. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  615. // Prevent compiler warnings about cached_has_bits being unused
  616. (void) cached_has_bits;
  617. nodes_.Clear();
  618. edges_.Clear();
  619. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  620. }
  621. const char* Map::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  622. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  623. ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  624. while (!ctx->Done(&ptr)) {
  625. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  626. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  627. CHK_(ptr);
  628. switch (tag >> 3) {
  629. // repeated .MapMessage.Node nodes = 1;
  630. case 1:
  631. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  632. ptr -= 1;
  633. do {
  634. ptr += 1;
  635. ptr = ctx->ParseMessage(_internal_add_nodes(), ptr);
  636. CHK_(ptr);
  637. if (!ctx->DataAvailable(ptr)) break;
  638. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
  639. } else goto handle_unusual;
  640. continue;
  641. // repeated .MapMessage.Edge edges = 2;
  642. case 2:
  643. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  644. ptr -= 1;
  645. do {
  646. ptr += 1;
  647. ptr = ctx->ParseMessage(_internal_add_edges(), ptr);
  648. CHK_(ptr);
  649. if (!ctx->DataAvailable(ptr)) break;
  650. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
  651. } else goto handle_unusual;
  652. continue;
  653. default: {
  654. handle_unusual:
  655. if ((tag & 7) == 4 || tag == 0) {
  656. ctx->SetLastTag(tag);
  657. goto success;
  658. }
  659. ptr = UnknownFieldParse(tag,
  660. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  661. ptr, ctx);
  662. CHK_(ptr != nullptr);
  663. continue;
  664. }
  665. } // switch
  666. } // while
  667. success:
  668. return ptr;
  669. failure:
  670. ptr = nullptr;
  671. goto success;
  672. #undef CHK_
  673. }
  674. ::PROTOBUF_NAMESPACE_ID::uint8* Map::_InternalSerialize(
  675. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  676. // @@protoc_insertion_point(serialize_to_array_start:MapMessage.Map)
  677. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  678. (void) cached_has_bits;
  679. // repeated .MapMessage.Node nodes = 1;
  680. for (unsigned int i = 0,
  681. n = static_cast<unsigned int>(this->_internal_nodes_size()); i < n; i++) {
  682. target = stream->EnsureSpace(target);
  683. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  684. InternalWriteMessage(1, this->_internal_nodes(i), target, stream);
  685. }
  686. // repeated .MapMessage.Edge edges = 2;
  687. for (unsigned int i = 0,
  688. n = static_cast<unsigned int>(this->_internal_edges_size()); i < n; i++) {
  689. target = stream->EnsureSpace(target);
  690. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  691. InternalWriteMessage(2, this->_internal_edges(i), target, stream);
  692. }
  693. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  694. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  695. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  696. }
  697. // @@protoc_insertion_point(serialize_to_array_end:MapMessage.Map)
  698. return target;
  699. }
  700. size_t Map::ByteSizeLong() const {
  701. // @@protoc_insertion_point(message_byte_size_start:MapMessage.Map)
  702. size_t total_size = 0;
  703. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  704. // Prevent compiler warnings about cached_has_bits being unused
  705. (void) cached_has_bits;
  706. // repeated .MapMessage.Node nodes = 1;
  707. total_size += 1UL * this->_internal_nodes_size();
  708. for (const auto& msg : this->nodes_) {
  709. total_size +=
  710. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  711. }
  712. // repeated .MapMessage.Edge edges = 2;
  713. total_size += 1UL * this->_internal_edges_size();
  714. for (const auto& msg : this->edges_) {
  715. total_size +=
  716. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  717. }
  718. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  719. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  720. _internal_metadata_, total_size, &_cached_size_);
  721. }
  722. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  723. SetCachedSize(cached_size);
  724. return total_size;
  725. }
  726. void Map::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  727. // @@protoc_insertion_point(generalized_merge_from_start:MapMessage.Map)
  728. GOOGLE_DCHECK_NE(&from, this);
  729. const Map* source =
  730. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Map>(
  731. &from);
  732. if (source == nullptr) {
  733. // @@protoc_insertion_point(generalized_merge_from_cast_fail:MapMessage.Map)
  734. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  735. } else {
  736. // @@protoc_insertion_point(generalized_merge_from_cast_success:MapMessage.Map)
  737. MergeFrom(*source);
  738. }
  739. }
  740. void Map::MergeFrom(const Map& from) {
  741. // @@protoc_insertion_point(class_specific_merge_from_start:MapMessage.Map)
  742. GOOGLE_DCHECK_NE(&from, this);
  743. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  744. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  745. (void) cached_has_bits;
  746. nodes_.MergeFrom(from.nodes_);
  747. edges_.MergeFrom(from.edges_);
  748. }
  749. void Map::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  750. // @@protoc_insertion_point(generalized_copy_from_start:MapMessage.Map)
  751. if (&from == this) return;
  752. Clear();
  753. MergeFrom(from);
  754. }
  755. void Map::CopyFrom(const Map& from) {
  756. // @@protoc_insertion_point(class_specific_copy_from_start:MapMessage.Map)
  757. if (&from == this) return;
  758. Clear();
  759. MergeFrom(from);
  760. }
  761. bool Map::IsInitialized() const {
  762. return true;
  763. }
  764. void Map::InternalSwap(Map* other) {
  765. using std::swap;
  766. _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
  767. nodes_.InternalSwap(&other->nodes_);
  768. edges_.InternalSwap(&other->edges_);
  769. }
  770. ::PROTOBUF_NAMESPACE_ID::Metadata Map::GetMetadata() const {
  771. return GetMetadataStatic();
  772. }
  773. // @@protoc_insertion_point(namespace_scope)
  774. } // namespace MapMessage
  775. PROTOBUF_NAMESPACE_OPEN
  776. template<> PROTOBUF_NOINLINE ::MapMessage::Node* Arena::CreateMaybeMessage< ::MapMessage::Node >(Arena* arena) {
  777. return Arena::CreateMessageInternal< ::MapMessage::Node >(arena);
  778. }
  779. template<> PROTOBUF_NOINLINE ::MapMessage::Edge* Arena::CreateMaybeMessage< ::MapMessage::Edge >(Arena* arena) {
  780. return Arena::CreateMessageInternal< ::MapMessage::Edge >(arena);
  781. }
  782. template<> PROTOBUF_NOINLINE ::MapMessage::Map* Arena::CreateMaybeMessage< ::MapMessage::Map >(Arena* arena) {
  783. return Arena::CreateMessageInternal< ::MapMessage::Map >(arena);
  784. }
  785. PROTOBUF_NAMESPACE_CLOSE
  786. // @@protoc_insertion_point(global_scope)
  787. #include <google/protobuf/port_undef.inc>