Browse Source

增加basemsg

zx 5 years ago
parent
commit
2a2408cf8d

+ 38 - 38
message/hardware_message.pb.cc

@@ -220,9 +220,9 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, cmd_msg_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, error_code_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Execute_response_msg, error_description_),
-  3,
-  1,
   2,
+  1,
+  3,
   0,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
@@ -1204,9 +1204,8 @@ Harware_statu_msg::Harware_statu_msg(const Harware_statu_msg& from)
 void Harware_statu_msg::SharedCtor() {
   _cached_size_ = 0;
   ::memset(&carrier1_statu_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&carrier3_statu_) -
-      reinterpret_cast<char*>(&carrier1_statu_)) + sizeof(carrier3_statu_));
-  msg_type_ = 1;
+      reinterpret_cast<char*>(&msg_type_) -
+      reinterpret_cast<char*>(&carrier1_statu_)) + sizeof(msg_type_));
 }
 
 Harware_statu_msg::~Harware_statu_msg() {
@@ -1250,7 +1249,7 @@ void Harware_statu_msg::Clear() {
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 15u) {
+  if (cached_has_bits & 7u) {
     if (cached_has_bits & 0x00000001u) {
       GOOGLE_DCHECK(carrier1_statu_ != NULL);
       carrier1_statu_->Clear();
@@ -1263,8 +1262,8 @@ void Harware_statu_msg::Clear() {
       GOOGLE_DCHECK(carrier3_statu_ != NULL);
       carrier3_statu_->Clear();
     }
-    msg_type_ = 1;
   }
+  msg_type_ = 0;
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -1640,8 +1639,9 @@ Execute_request_msg::Execute_request_msg(const Execute_request_msg& from)
 
 void Execute_request_msg::SharedCtor() {
   _cached_size_ = 0;
-  cmd_msg_ = NULL;
-  msg_type_ = 1;
+  ::memset(&cmd_msg_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&msg_type_) -
+      reinterpret_cast<char*>(&cmd_msg_)) + sizeof(msg_type_));
   time_out_ = 200000;
 }
 
@@ -1684,12 +1684,12 @@ void Execute_request_msg::Clear() {
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 7u) {
-    if (cached_has_bits & 0x00000001u) {
-      GOOGLE_DCHECK(cmd_msg_ != NULL);
-      cmd_msg_->Clear();
-    }
-    msg_type_ = 1;
+  if (cached_has_bits & 0x00000001u) {
+    GOOGLE_DCHECK(cmd_msg_ != NULL);
+    cmd_msg_->Clear();
+  }
+  if (cached_has_bits & 6u) {
+    msg_type_ = 0;
     time_out_ = 200000;
   }
   _has_bits_.Clear();
@@ -2011,9 +2011,9 @@ Execute_response_msg::Execute_response_msg(const Execute_response_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  ::memcpy(&error_code_, &from.error_code_,
-    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
-    reinterpret_cast<char*>(&error_code_)) + sizeof(msg_type_));
+  ::memcpy(&msg_type_, &from.msg_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&error_code_) -
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(error_code_));
   // @@protoc_insertion_point(copy_constructor:message.Execute_response_msg)
 }
 
@@ -2023,7 +2023,6 @@ void Execute_response_msg::SharedCtor() {
   ::memset(&cmd_msg_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&error_code_) -
       reinterpret_cast<char*>(&cmd_msg_)) + sizeof(error_code_));
-  msg_type_ = 1;
 }
 
 Execute_response_msg::~Execute_response_msg() {
@@ -2077,8 +2076,9 @@ void Execute_response_msg::Clear() {
     }
   }
   if (cached_has_bits & 12u) {
-    error_code_ = 0;
-    msg_type_ = 1;
+    ::memset(&msg_type_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&error_code_) -
+        reinterpret_cast<char*>(&msg_type_)) + sizeof(error_code_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -2184,7 +2184,7 @@ void Execute_response_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       1, this->msg_type(), output);
   }
@@ -2196,7 +2196,7 @@ void Execute_response_msg::SerializeWithCachedSizes(
   }
 
   // required int32 error_code = 3;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->error_code(), output);
   }
 
@@ -2226,7 +2226,7 @@ void Execute_response_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       1, this->msg_type(), target);
   }
@@ -2239,7 +2239,7 @@ void Execute_response_msg::SerializeWithCachedSizes(
   }
 
   // required int32 error_code = 3;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->error_code(), target);
   }
 
@@ -2273,6 +2273,12 @@ size_t Execute_response_msg::RequiredFieldsByteSizeFallback() const {
         *this->cmd_msg_);
   }
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   if (has_error_code()) {
     // required int32 error_code = 3;
     total_size += 1 +
@@ -2280,12 +2286,6 @@ size_t Execute_response_msg::RequiredFieldsByteSizeFallback() const {
         this->error_code());
   }
 
-  if (has_msg_type()) {
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-  }
-
   return total_size;
 }
 size_t Execute_response_msg::ByteSizeLong() const {
@@ -2303,15 +2303,15 @@ size_t Execute_response_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
 
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
     // required int32 error_code = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->error_code());
 
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -2361,10 +2361,10 @@ void Execute_response_msg::MergeFrom(const Execute_response_msg& from) {
       mutable_cmd_msg()->::message::Command_message::MergeFrom(from.cmd_msg());
     }
     if (cached_has_bits & 0x00000004u) {
-      error_code_ = from.error_code_;
+      msg_type_ = from.msg_type_;
     }
     if (cached_has_bits & 0x00000008u) {
-      msg_type_ = from.msg_type_;
+      error_code_ = from.error_code_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
@@ -2400,8 +2400,8 @@ void Execute_response_msg::InternalSwap(Execute_response_msg* other) {
   using std::swap;
   error_description_.Swap(&other->error_description_);
   swap(cmd_msg_, other->cmd_msg_);
-  swap(error_code_, other->error_code_);
   swap(msg_type_, other->msg_type_);
+  swap(error_code_, other->error_code_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 17 - 17
message/hardware_message.pb.h

@@ -799,13 +799,6 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required int32 error_code = 3;
-  bool has_error_code() const;
-  void clear_error_code();
-  static const int kErrorCodeFieldNumber = 3;
-  ::google::protobuf::int32 error_code() const;
-  void set_error_code(::google::protobuf::int32 value);
-
   // required .message.Message_type msg_type = 1;
   bool has_msg_type() const;
   void clear_msg_type();
@@ -813,6 +806,13 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::message::Message_type msg_type() const;
   void set_msg_type(::message::Message_type value);
 
+  // required int32 error_code = 3;
+  bool has_error_code() const;
+  void clear_error_code();
+  static const int kErrorCodeFieldNumber = 3;
+  ::google::protobuf::int32 error_code() const;
+  void set_error_code(::google::protobuf::int32 value);
+
   // @@protoc_insertion_point(class_scope:message.Execute_response_msg)
  private:
   void set_has_msg_type();
@@ -832,8 +832,8 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   mutable int _cached_size_;
   ::google::protobuf::internal::ArenaStringPtr error_description_;
   ::message::Command_message* cmd_msg_;
-  ::google::protobuf::int32 error_code_;
   int msg_type_;
+  ::google::protobuf::int32 error_code_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsExecute_response_msgImpl();
 };
@@ -1155,7 +1155,7 @@ inline void Harware_statu_msg::clear_has_msg_type() {
   _has_bits_[0] &= ~0x00000008u;
 }
 inline void Harware_statu_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Harware_statu_msg::msg_type() const {
@@ -1346,7 +1346,7 @@ inline void Execute_request_msg::clear_has_msg_type() {
   _has_bits_[0] &= ~0x00000002u;
 }
 inline void Execute_request_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Execute_request_msg::msg_type() const {
@@ -1440,16 +1440,16 @@ inline void Execute_request_msg::set_time_out(::google::protobuf::int32 value) {
 
 // required .message.Message_type msg_type = 1;
 inline bool Execute_response_msg::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Execute_response_msg::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Execute_response_msg::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Execute_response_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Execute_response_msg::msg_type() const {
@@ -1515,13 +1515,13 @@ inline void Execute_response_msg::set_allocated_cmd_msg(::message::Command_messa
 
 // required int32 error_code = 3;
 inline bool Execute_response_msg::has_error_code() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Execute_response_msg::set_has_error_code() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Execute_response_msg::clear_has_error_code() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Execute_response_msg::clear_error_code() {
   error_code_ = 0;

+ 4 - 4
message/hardware_message.proto

@@ -32,7 +32,7 @@ message Carrier_status
 //搬运机构各个零部件状态
 message Harware_statu_msg
 {
-    required Message_type               msg_type=1;         //消息类型
+    required Message_type               msg_type=1;                 //消息类型
     required Carrier_status             carrier1_statu=2;           //搬运器1状态
     required Carrier_status             carrier2_statu=3;           //搬运器2状态
     required Carrier_status             carrier3_statu=4;           //搬运器3状态
@@ -41,15 +41,15 @@ message Harware_statu_msg
 //执行搬运请求
 message Execute_request_msg
 {
-    required Message_type               msg_type=1;         //消息类型
+    required Message_type               msg_type=1;                             //消息类型
     required Command_message            cmd_msg=2;                              //指令信息
-    optional int32                      time_out=3 [default=200000];           //定位测量超时设置,默认200s
+    optional int32                      time_out=3 [default=200000];            //定位测量超时设置,默认200s
 }
 
 //搬运动作执行完成后反馈结果
 message Execute_response_msg
 {
-    required Message_type               msg_type=1;         //消息类型
+    required Message_type               msg_type=1;                     //消息类型
     required Command_message            cmd_msg=2;
     required int32                      error_code=3;
     optional string                     error_description=4;

+ 111 - 115
message/locate_message.pb.cc

@@ -118,12 +118,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_status_msg, dj_statu2_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_status_msg, dj_statu3_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_status_msg, dj_statu4_),
-  5,
-  0,
   1,
+  0,
   2,
   3,
   4,
+  5,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_request_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_request_msg, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -133,9 +133,9 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_request_msg, cmd_msg_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_request_msg, locate_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_request_msg, time_out_),
-  2,
-  0,
   1,
+  0,
+  2,
   3,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_response_msg, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_response_msg, _internal_metadata_),
@@ -153,17 +153,17 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_response_msg, x_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_response_msg, y_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Locate_response_msg, theta_),
-  10,
-  1,
   2,
-  0,
+  1,
   3,
+  0,
   4,
   5,
   6,
   7,
   8,
   9,
+  10,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 11, sizeof(::message::Locate_status_msg)},
@@ -309,9 +309,9 @@ Locate_status_msg::Locate_status_msg(const Locate_status_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  ::memcpy(&dj_statu1_, &from.dj_statu1_,
-    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
-    reinterpret_cast<char*>(&dj_statu1_)) + sizeof(msg_type_));
+  ::memcpy(&msg_type_, &from.msg_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&dj_statu4_) -
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(dj_statu4_));
   // @@protoc_insertion_point(copy_constructor:message.Locate_status_msg)
 }
 
@@ -320,7 +320,6 @@ void Locate_status_msg::SharedCtor() {
   ::memset(&cmd_msg_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&dj_statu4_) -
       reinterpret_cast<char*>(&cmd_msg_)) + sizeof(dj_statu4_));
-  msg_type_ = 1;
 }
 
 Locate_status_msg::~Locate_status_msg() {
@@ -367,10 +366,9 @@ void Locate_status_msg::Clear() {
     cmd_msg_->Clear();
   }
   if (cached_has_bits & 62u) {
-    ::memset(&dj_statu1_, 0, static_cast<size_t>(
+    ::memset(&msg_type_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&dj_statu4_) -
-        reinterpret_cast<char*>(&dj_statu1_)) + sizeof(dj_statu4_));
-    msg_type_ = 1;
+        reinterpret_cast<char*>(&msg_type_)) + sizeof(dj_statu4_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -526,7 +524,7 @@ void Locate_status_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       1, this->msg_type(), output);
   }
@@ -538,25 +536,25 @@ void Locate_status_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Lidar_statu dj_statu1 = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->dj_statu1(), output);
   }
 
   // required .message.Lidar_statu dj_statu2 = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       4, this->dj_statu2(), output);
   }
 
   // required .message.Lidar_statu dj_statu3 = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       5, this->dj_statu3(), output);
   }
 
   // required .message.Lidar_statu dj_statu4 = 6;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       6, this->dj_statu4(), output);
   }
@@ -577,7 +575,7 @@ void Locate_status_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       1, this->msg_type(), target);
   }
@@ -590,25 +588,25 @@ void Locate_status_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Lidar_statu dj_statu1 = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->dj_statu1(), target);
   }
 
   // required .message.Lidar_statu dj_statu2 = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       4, this->dj_statu2(), target);
   }
 
   // required .message.Lidar_statu dj_statu3 = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       5, this->dj_statu3(), target);
   }
 
   // required .message.Lidar_statu dj_statu4 = 6;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       6, this->dj_statu4(), target);
   }
@@ -625,6 +623,12 @@ size_t Locate_status_msg::RequiredFieldsByteSizeFallback() const {
 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Locate_status_msg)
   size_t total_size = 0;
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   if (has_dj_statu1()) {
     // required .message.Lidar_statu dj_statu1 = 3;
     total_size += 1 +
@@ -649,12 +653,6 @@ size_t Locate_status_msg::RequiredFieldsByteSizeFallback() const {
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->dj_statu4());
   }
 
-  if (has_msg_type()) {
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-  }
-
   return total_size;
 }
 size_t Locate_status_msg::ByteSizeLong() const {
@@ -667,6 +665,10 @@ size_t Locate_status_msg::ByteSizeLong() const {
         _internal_metadata_.unknown_fields());
   }
   if (((_has_bits_[0] & 0x0000003e) ^ 0x0000003e) == 0) {  // All required fields are present.
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
     // required .message.Lidar_statu dj_statu1 = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->dj_statu1());
@@ -683,10 +685,6 @@ size_t Locate_status_msg::ByteSizeLong() const {
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->dj_statu4());
 
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -732,19 +730,19 @@ void Locate_status_msg::MergeFrom(const Locate_status_msg& from) {
       mutable_cmd_msg()->::message::Command_message::MergeFrom(from.cmd_msg());
     }
     if (cached_has_bits & 0x00000002u) {
-      dj_statu1_ = from.dj_statu1_;
+      msg_type_ = from.msg_type_;
     }
     if (cached_has_bits & 0x00000004u) {
-      dj_statu2_ = from.dj_statu2_;
+      dj_statu1_ = from.dj_statu1_;
     }
     if (cached_has_bits & 0x00000008u) {
-      dj_statu3_ = from.dj_statu3_;
+      dj_statu2_ = from.dj_statu2_;
     }
     if (cached_has_bits & 0x00000010u) {
-      dj_statu4_ = from.dj_statu4_;
+      dj_statu3_ = from.dj_statu3_;
     }
     if (cached_has_bits & 0x00000020u) {
-      msg_type_ = from.msg_type_;
+      dj_statu4_ = from.dj_statu4_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
@@ -779,11 +777,11 @@ void Locate_status_msg::Swap(Locate_status_msg* other) {
 void Locate_status_msg::InternalSwap(Locate_status_msg* other) {
   using std::swap;
   swap(cmd_msg_, other->cmd_msg_);
+  swap(msg_type_, other->msg_type_);
   swap(dj_statu1_, other->dj_statu1_);
   swap(dj_statu2_, other->dj_statu2_);
   swap(dj_statu3_, other->dj_statu3_);
   swap(dj_statu4_, other->dj_statu4_);
-  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);
@@ -831,9 +829,9 @@ Locate_request_msg::Locate_request_msg(const Locate_request_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  ::memcpy(&locate_type_, &from.locate_type_,
+  ::memcpy(&msg_type_, &from.msg_type_,
     static_cast<size_t>(reinterpret_cast<char*>(&time_out_) -
-    reinterpret_cast<char*>(&locate_type_)) + sizeof(time_out_));
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(time_out_));
   // @@protoc_insertion_point(copy_constructor:message.Locate_request_msg)
 }
 
@@ -842,7 +840,6 @@ void Locate_request_msg::SharedCtor() {
   ::memset(&cmd_msg_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&locate_type_) -
       reinterpret_cast<char*>(&cmd_msg_)) + sizeof(locate_type_));
-  msg_type_ = 1;
   time_out_ = 5000;
 }
 
@@ -890,8 +887,9 @@ void Locate_request_msg::Clear() {
     cmd_msg_->Clear();
   }
   if (cached_has_bits & 14u) {
-    locate_type_ = 0;
-    msg_type_ = 1;
+    ::memset(&msg_type_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&locate_type_) -
+        reinterpret_cast<char*>(&msg_type_)) + sizeof(locate_type_));
     time_out_ = 5000;
   }
   _has_bits_.Clear();
@@ -1002,7 +1000,7 @@ void Locate_request_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       1, this->msg_type(), output);
   }
@@ -1014,7 +1012,7 @@ void Locate_request_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Locate_type locate_type = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->locate_type(), output);
   }
@@ -1040,7 +1038,7 @@ void Locate_request_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       1, this->msg_type(), target);
   }
@@ -1053,7 +1051,7 @@ void Locate_request_msg::SerializeWithCachedSizes(
   }
 
   // required .message.Locate_type locate_type = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->locate_type(), target);
   }
@@ -1082,18 +1080,18 @@ size_t Locate_request_msg::RequiredFieldsByteSizeFallback() const {
         *this->cmd_msg_);
   }
 
-  if (has_locate_type()) {
-    // required .message.Locate_type locate_type = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->locate_type());
-  }
-
   if (has_msg_type()) {
     // required .message.Message_type msg_type = 1;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
   }
 
+  if (has_locate_type()) {
+    // required .message.Locate_type locate_type = 3;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->locate_type());
+  }
+
   return total_size;
 }
 size_t Locate_request_msg::ByteSizeLong() const {
@@ -1111,14 +1109,14 @@ size_t Locate_request_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
 
-    // required .message.Locate_type locate_type = 3;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->locate_type());
-
     // required .message.Message_type msg_type = 1;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
 
+    // required .message.Locate_type locate_type = 3;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->locate_type());
+
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -1164,10 +1162,10 @@ void Locate_request_msg::MergeFrom(const Locate_request_msg& from) {
       mutable_cmd_msg()->::message::Command_message::MergeFrom(from.cmd_msg());
     }
     if (cached_has_bits & 0x00000002u) {
-      locate_type_ = from.locate_type_;
+      msg_type_ = from.msg_type_;
     }
     if (cached_has_bits & 0x00000004u) {
-      msg_type_ = from.msg_type_;
+      locate_type_ = from.locate_type_;
     }
     if (cached_has_bits & 0x00000008u) {
       time_out_ = from.time_out_;
@@ -1205,8 +1203,8 @@ void Locate_request_msg::Swap(Locate_request_msg* other) {
 void Locate_request_msg::InternalSwap(Locate_request_msg* other) {
   using std::swap;
   swap(cmd_msg_, other->cmd_msg_);
-  swap(locate_type_, other->locate_type_);
   swap(msg_type_, other->msg_type_);
+  swap(locate_type_, other->locate_type_);
   swap(time_out_, other->time_out_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
@@ -1266,9 +1264,9 @@ Locate_response_msg::Locate_response_msg(const Locate_response_msg& from)
   } else {
     cmd_msg_ = NULL;
   }
-  ::memcpy(&error_code_, &from.error_code_,
-    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
-    reinterpret_cast<char*>(&error_code_)) + sizeof(msg_type_));
+  ::memcpy(&msg_type_, &from.msg_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&theta_) -
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(theta_));
   // @@protoc_insertion_point(copy_constructor:message.Locate_response_msg)
 }
 
@@ -1278,7 +1276,6 @@ void Locate_response_msg::SharedCtor() {
   ::memset(&cmd_msg_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&theta_) -
       reinterpret_cast<char*>(&cmd_msg_)) + sizeof(theta_));
-  msg_type_ = 1;
 }
 
 Locate_response_msg::~Locate_response_msg() {
@@ -1332,15 +1329,14 @@ void Locate_response_msg::Clear() {
     }
   }
   if (cached_has_bits & 252u) {
-    ::memset(&error_code_, 0, static_cast<size_t>(
-        reinterpret_cast<char*>(&x_) -
-        reinterpret_cast<char*>(&error_code_)) + sizeof(x_));
+    ::memset(&msg_type_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&wheel_base_) -
+        reinterpret_cast<char*>(&msg_type_)) + sizeof(wheel_base_));
   }
   if (cached_has_bits & 1792u) {
-    ::memset(&y_, 0, static_cast<size_t>(
+    ::memset(&x_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&theta_) -
-        reinterpret_cast<char*>(&y_)) + sizeof(theta_));
-    msg_type_ = 1;
+        reinterpret_cast<char*>(&x_)) + sizeof(theta_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -1544,7 +1540,7 @@ void Locate_response_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000400u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       1, this->msg_type(), output);
   }
@@ -1556,7 +1552,7 @@ void Locate_response_msg::SerializeWithCachedSizes(
   }
 
   // required int32 error_code = 3;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->error_code(), output);
   }
 
@@ -1571,37 +1567,37 @@ void Locate_response_msg::SerializeWithCachedSizes(
   }
 
   // optional float length = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->length(), output);
   }
 
   // optional float width = 6;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->width(), output);
   }
 
   // optional float height = 7;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->height(), output);
   }
 
   // optional float wheel_base = 8;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->wheel_base(), output);
   }
 
   // optional float x = 9;
-  if (cached_has_bits & 0x00000080u) {
+  if (cached_has_bits & 0x00000100u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->x(), output);
   }
 
   // optional float y = 10;
-  if (cached_has_bits & 0x00000100u) {
+  if (cached_has_bits & 0x00000200u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->y(), output);
   }
 
   // optional float theta = 11;
-  if (cached_has_bits & 0x00000200u) {
+  if (cached_has_bits & 0x00000400u) {
     ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->theta(), output);
   }
 
@@ -1621,7 +1617,7 @@ void Locate_response_msg::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000400u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       1, this->msg_type(), target);
   }
@@ -1634,7 +1630,7 @@ void Locate_response_msg::SerializeWithCachedSizes(
   }
 
   // required int32 error_code = 3;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->error_code(), target);
   }
 
@@ -1650,37 +1646,37 @@ void Locate_response_msg::SerializeWithCachedSizes(
   }
 
   // optional float length = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->length(), target);
   }
 
   // optional float width = 6;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000020u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->width(), target);
   }
 
   // optional float height = 7;
-  if (cached_has_bits & 0x00000020u) {
+  if (cached_has_bits & 0x00000040u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->height(), target);
   }
 
   // optional float wheel_base = 8;
-  if (cached_has_bits & 0x00000040u) {
+  if (cached_has_bits & 0x00000080u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->wheel_base(), target);
   }
 
   // optional float x = 9;
-  if (cached_has_bits & 0x00000080u) {
+  if (cached_has_bits & 0x00000100u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->x(), target);
   }
 
   // optional float y = 10;
-  if (cached_has_bits & 0x00000100u) {
+  if (cached_has_bits & 0x00000200u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->y(), target);
   }
 
   // optional float theta = 11;
-  if (cached_has_bits & 0x00000200u) {
+  if (cached_has_bits & 0x00000400u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->theta(), target);
   }
 
@@ -1703,6 +1699,12 @@ size_t Locate_response_msg::RequiredFieldsByteSizeFallback() const {
         *this->cmd_msg_);
   }
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   if (has_error_code()) {
     // required int32 error_code = 3;
     total_size += 1 +
@@ -1710,12 +1712,6 @@ size_t Locate_response_msg::RequiredFieldsByteSizeFallback() const {
         this->error_code());
   }
 
-  if (has_msg_type()) {
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-  }
-
   return total_size;
 }
 size_t Locate_response_msg::ByteSizeLong() const {
@@ -1727,21 +1723,21 @@ size_t Locate_response_msg::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x00000406) ^ 0x00000406) == 0) {  // All required fields are present.
+  if (((_has_bits_[0] & 0x0000000e) ^ 0x0000000e) == 0) {  // All required fields are present.
     // required .message.Command_message cmd_msg = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::MessageSize(
         *this->cmd_msg_);
 
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
     // required int32 error_code = 3;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->error_code());
 
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -1752,7 +1748,7 @@ size_t Locate_response_msg::ByteSizeLong() const {
         this->error_description());
   }
 
-  if (_has_bits_[0 / 32] & 248u) {
+  if (_has_bits_[0 / 32] & 240u) {
     // optional float length = 5;
     if (has_length()) {
       total_size += 1 + 4;
@@ -1773,13 +1769,13 @@ size_t Locate_response_msg::ByteSizeLong() const {
       total_size += 1 + 4;
     }
 
+  }
+  if (_has_bits_[8 / 32] & 1792u) {
     // optional float x = 9;
     if (has_x()) {
       total_size += 1 + 4;
     }
 
-  }
-  if (_has_bits_[8 / 32] & 768u) {
     // optional float y = 10;
     if (has_y()) {
       total_size += 1 + 4;
@@ -1830,34 +1826,34 @@ void Locate_response_msg::MergeFrom(const Locate_response_msg& from) {
       mutable_cmd_msg()->::message::Command_message::MergeFrom(from.cmd_msg());
     }
     if (cached_has_bits & 0x00000004u) {
-      error_code_ = from.error_code_;
+      msg_type_ = from.msg_type_;
     }
     if (cached_has_bits & 0x00000008u) {
-      length_ = from.length_;
+      error_code_ = from.error_code_;
     }
     if (cached_has_bits & 0x00000010u) {
-      width_ = from.width_;
+      length_ = from.length_;
     }
     if (cached_has_bits & 0x00000020u) {
-      height_ = from.height_;
+      width_ = from.width_;
     }
     if (cached_has_bits & 0x00000040u) {
-      wheel_base_ = from.wheel_base_;
+      height_ = from.height_;
     }
     if (cached_has_bits & 0x00000080u) {
-      x_ = from.x_;
+      wheel_base_ = from.wheel_base_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
   if (cached_has_bits & 1792u) {
     if (cached_has_bits & 0x00000100u) {
-      y_ = from.y_;
+      x_ = from.x_;
     }
     if (cached_has_bits & 0x00000200u) {
-      theta_ = from.theta_;
+      y_ = from.y_;
     }
     if (cached_has_bits & 0x00000400u) {
-      msg_type_ = from.msg_type_;
+      theta_ = from.theta_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
@@ -1878,7 +1874,7 @@ void Locate_response_msg::CopyFrom(const Locate_response_msg& from) {
 }
 
 bool Locate_response_msg::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000406) != 0x00000406) return false;
+  if ((_has_bits_[0] & 0x0000000e) != 0x0000000e) return false;
   if (has_cmd_msg()) {
     if (!this->cmd_msg_->IsInitialized()) return false;
   }
@@ -1893,6 +1889,7 @@ void Locate_response_msg::InternalSwap(Locate_response_msg* other) {
   using std::swap;
   error_description_.Swap(&other->error_description_);
   swap(cmd_msg_, other->cmd_msg_);
+  swap(msg_type_, other->msg_type_);
   swap(error_code_, other->error_code_);
   swap(length_, other->length_);
   swap(width_, other->width_);
@@ -1901,7 +1898,6 @@ void Locate_response_msg::InternalSwap(Locate_response_msg* other) {
   swap(x_, other->x_);
   swap(y_, other->y_);
   swap(theta_, other->theta_);
-  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 75 - 75
message/locate_message.pb.h

@@ -208,6 +208,13 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // required .message.Lidar_statu dj_statu1 = 3;
   bool has_dj_statu1() const;
   void clear_dj_statu1();
@@ -236,13 +243,6 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   ::message::Lidar_statu dj_statu4() const;
   void set_dj_statu4(::message::Lidar_statu value);
 
-  // required .message.Message_type msg_type = 1;
-  bool has_msg_type() const;
-  void clear_msg_type();
-  static const int kMsgTypeFieldNumber = 1;
-  ::message::Message_type msg_type() const;
-  void set_msg_type(::message::Message_type value);
-
   // @@protoc_insertion_point(class_scope:message.Locate_status_msg)
  private:
   void set_has_msg_type();
@@ -265,11 +265,11 @@ class Locate_status_msg : public ::google::protobuf::Message /* @@protoc_inserti
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::message::Command_message* cmd_msg_;
+  int msg_type_;
   int dj_statu1_;
   int dj_statu2_;
   int dj_statu3_;
   int dj_statu4_;
-  int msg_type_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_status_msgImpl();
 };
@@ -373,13 +373,6 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
-  // required .message.Locate_type locate_type = 3;
-  bool has_locate_type() const;
-  void clear_locate_type();
-  static const int kLocateTypeFieldNumber = 3;
-  ::message::Locate_type locate_type() const;
-  void set_locate_type(::message::Locate_type value);
-
   // required .message.Message_type msg_type = 1;
   bool has_msg_type() const;
   void clear_msg_type();
@@ -387,6 +380,13 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::message::Message_type msg_type() const;
   void set_msg_type(::message::Message_type value);
 
+  // required .message.Locate_type locate_type = 3;
+  bool has_locate_type() const;
+  void clear_locate_type();
+  static const int kLocateTypeFieldNumber = 3;
+  ::message::Locate_type locate_type() const;
+  void set_locate_type(::message::Locate_type value);
+
   // optional int32 time_out = 4 [default = 5000];
   bool has_time_out() const;
   void clear_time_out();
@@ -412,8 +412,8 @@ class Locate_request_msg : public ::google::protobuf::Message /* @@protoc_insert
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::message::Command_message* cmd_msg_;
-  int locate_type_;
   int msg_type_;
+  int locate_type_;
   ::google::protobuf::int32 time_out_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_request_msgImpl();
@@ -533,6 +533,13 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   ::message::Command_message* mutable_cmd_msg();
   void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // required int32 error_code = 3;
   bool has_error_code() const;
   void clear_error_code();
@@ -589,13 +596,6 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   float theta() const;
   void set_theta(float value);
 
-  // required .message.Message_type msg_type = 1;
-  bool has_msg_type() const;
-  void clear_msg_type();
-  static const int kMsgTypeFieldNumber = 1;
-  ::message::Message_type msg_type() const;
-  void set_msg_type(::message::Message_type value);
-
   // @@protoc_insertion_point(class_scope:message.Locate_response_msg)
  private:
   void set_has_msg_type();
@@ -629,6 +629,7 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   mutable int _cached_size_;
   ::google::protobuf::internal::ArenaStringPtr error_description_;
   ::message::Command_message* cmd_msg_;
+  int msg_type_;
   ::google::protobuf::int32 error_code_;
   float length_;
   float width_;
@@ -637,7 +638,6 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
   float x_;
   float y_;
   float theta_;
-  int msg_type_;
   friend struct ::protobuf_locate_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_locate_5fmessage_2eproto::InitDefaultsLocate_response_msgImpl();
 };
@@ -654,16 +654,16 @@ class Locate_response_msg : public ::google::protobuf::Message /* @@protoc_inser
 
 // required .message.Message_type msg_type = 1;
 inline bool Locate_status_msg::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000002u) != 0;
 }
 inline void Locate_status_msg::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000002u;
 }
 inline void Locate_status_msg::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000002u;
 }
 inline void Locate_status_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Locate_status_msg::msg_type() const {
@@ -729,13 +729,13 @@ inline void Locate_status_msg::set_allocated_cmd_msg(::message::Command_message*
 
 // required .message.Lidar_statu dj_statu1 = 3;
 inline bool Locate_status_msg::has_dj_statu1() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Locate_status_msg::set_has_dj_statu1() {
-  _has_bits_[0] |= 0x00000002u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Locate_status_msg::clear_has_dj_statu1() {
-  _has_bits_[0] &= ~0x00000002u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Locate_status_msg::clear_dj_statu1() {
   dj_statu1_ = 0;
@@ -754,13 +754,13 @@ inline void Locate_status_msg::set_dj_statu1(::message::Lidar_statu value) {
 
 // required .message.Lidar_statu dj_statu2 = 4;
 inline bool Locate_status_msg::has_dj_statu2() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Locate_status_msg::set_has_dj_statu2() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Locate_status_msg::clear_has_dj_statu2() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Locate_status_msg::clear_dj_statu2() {
   dj_statu2_ = 0;
@@ -779,13 +779,13 @@ inline void Locate_status_msg::set_dj_statu2(::message::Lidar_statu value) {
 
 // required .message.Lidar_statu dj_statu3 = 5;
 inline bool Locate_status_msg::has_dj_statu3() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void Locate_status_msg::set_has_dj_statu3() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void Locate_status_msg::clear_has_dj_statu3() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void Locate_status_msg::clear_dj_statu3() {
   dj_statu3_ = 0;
@@ -804,13 +804,13 @@ inline void Locate_status_msg::set_dj_statu3(::message::Lidar_statu value) {
 
 // required .message.Lidar_statu dj_statu4 = 6;
 inline bool Locate_status_msg::has_dj_statu4() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
 inline void Locate_status_msg::set_has_dj_statu4() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000020u;
 }
 inline void Locate_status_msg::clear_has_dj_statu4() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000020u;
 }
 inline void Locate_status_msg::clear_dj_statu4() {
   dj_statu4_ = 0;
@@ -833,16 +833,16 @@ inline void Locate_status_msg::set_dj_statu4(::message::Lidar_statu value) {
 
 // required .message.Message_type msg_type = 1;
 inline bool Locate_request_msg::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000002u) != 0;
 }
 inline void Locate_request_msg::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000002u;
 }
 inline void Locate_request_msg::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000002u;
 }
 inline void Locate_request_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Locate_request_msg::msg_type() const {
@@ -908,13 +908,13 @@ inline void Locate_request_msg::set_allocated_cmd_msg(::message::Command_message
 
 // required .message.Locate_type locate_type = 3;
 inline bool Locate_request_msg::has_locate_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Locate_request_msg::set_has_locate_type() {
-  _has_bits_[0] |= 0x00000002u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Locate_request_msg::clear_has_locate_type() {
-  _has_bits_[0] &= ~0x00000002u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Locate_request_msg::clear_locate_type() {
   locate_type_ = 0;
@@ -961,16 +961,16 @@ inline void Locate_request_msg::set_time_out(::google::protobuf::int32 value) {
 
 // required .message.Message_type msg_type = 1;
 inline bool Locate_response_msg::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000400u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Locate_response_msg::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000400u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Locate_response_msg::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000400u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Locate_response_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Locate_response_msg::msg_type() const {
@@ -1036,13 +1036,13 @@ inline void Locate_response_msg::set_allocated_cmd_msg(::message::Command_messag
 
 // required int32 error_code = 3;
 inline bool Locate_response_msg::has_error_code() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Locate_response_msg::set_has_error_code() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Locate_response_msg::clear_has_error_code() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Locate_response_msg::clear_error_code() {
   error_code_ = 0;
@@ -1123,13 +1123,13 @@ inline void Locate_response_msg::set_allocated_error_description(::std::string*
 
 // optional float length = 5;
 inline bool Locate_response_msg::has_length() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void Locate_response_msg::set_has_length() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void Locate_response_msg::clear_has_length() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void Locate_response_msg::clear_length() {
   length_ = 0;
@@ -1147,13 +1147,13 @@ inline void Locate_response_msg::set_length(float value) {
 
 // optional float width = 6;
 inline bool Locate_response_msg::has_width() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000020u) != 0;
 }
 inline void Locate_response_msg::set_has_width() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000020u;
 }
 inline void Locate_response_msg::clear_has_width() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000020u;
 }
 inline void Locate_response_msg::clear_width() {
   width_ = 0;
@@ -1171,13 +1171,13 @@ inline void Locate_response_msg::set_width(float value) {
 
 // optional float height = 7;
 inline bool Locate_response_msg::has_height() const {
-  return (_has_bits_[0] & 0x00000020u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 inline void Locate_response_msg::set_has_height() {
-  _has_bits_[0] |= 0x00000020u;
+  _has_bits_[0] |= 0x00000040u;
 }
 inline void Locate_response_msg::clear_has_height() {
-  _has_bits_[0] &= ~0x00000020u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 inline void Locate_response_msg::clear_height() {
   height_ = 0;
@@ -1195,13 +1195,13 @@ inline void Locate_response_msg::set_height(float value) {
 
 // optional float wheel_base = 8;
 inline bool Locate_response_msg::has_wheel_base() const {
-  return (_has_bits_[0] & 0x00000040u) != 0;
+  return (_has_bits_[0] & 0x00000080u) != 0;
 }
 inline void Locate_response_msg::set_has_wheel_base() {
-  _has_bits_[0] |= 0x00000040u;
+  _has_bits_[0] |= 0x00000080u;
 }
 inline void Locate_response_msg::clear_has_wheel_base() {
-  _has_bits_[0] &= ~0x00000040u;
+  _has_bits_[0] &= ~0x00000080u;
 }
 inline void Locate_response_msg::clear_wheel_base() {
   wheel_base_ = 0;
@@ -1219,13 +1219,13 @@ inline void Locate_response_msg::set_wheel_base(float value) {
 
 // optional float x = 9;
 inline bool Locate_response_msg::has_x() const {
-  return (_has_bits_[0] & 0x00000080u) != 0;
+  return (_has_bits_[0] & 0x00000100u) != 0;
 }
 inline void Locate_response_msg::set_has_x() {
-  _has_bits_[0] |= 0x00000080u;
+  _has_bits_[0] |= 0x00000100u;
 }
 inline void Locate_response_msg::clear_has_x() {
-  _has_bits_[0] &= ~0x00000080u;
+  _has_bits_[0] &= ~0x00000100u;
 }
 inline void Locate_response_msg::clear_x() {
   x_ = 0;
@@ -1243,13 +1243,13 @@ inline void Locate_response_msg::set_x(float value) {
 
 // optional float y = 10;
 inline bool Locate_response_msg::has_y() const {
-  return (_has_bits_[0] & 0x00000100u) != 0;
+  return (_has_bits_[0] & 0x00000200u) != 0;
 }
 inline void Locate_response_msg::set_has_y() {
-  _has_bits_[0] |= 0x00000100u;
+  _has_bits_[0] |= 0x00000200u;
 }
 inline void Locate_response_msg::clear_has_y() {
-  _has_bits_[0] &= ~0x00000100u;
+  _has_bits_[0] &= ~0x00000200u;
 }
 inline void Locate_response_msg::clear_y() {
   y_ = 0;
@@ -1267,13 +1267,13 @@ inline void Locate_response_msg::set_y(float value) {
 
 // optional float theta = 11;
 inline bool Locate_response_msg::has_theta() const {
-  return (_has_bits_[0] & 0x00000200u) != 0;
+  return (_has_bits_[0] & 0x00000400u) != 0;
 }
 inline void Locate_response_msg::set_has_theta() {
-  _has_bits_[0] |= 0x00000200u;
+  _has_bits_[0] |= 0x00000400u;
 }
 inline void Locate_response_msg::clear_has_theta() {
-  _has_bits_[0] &= ~0x00000200u;
+  _has_bits_[0] &= ~0x00000400u;
 }
 inline void Locate_response_msg::clear_theta() {
   theta_ = 0;

+ 6 - 7
message/locate_message.proto

@@ -12,8 +12,8 @@ enum Lidar_statu        //雷达状态
 //定位模块状态
 message Locate_status_msg
 {
-    required Message_type               msg_type=1;         //消息类型
-    optional Command_message            cmd_msg=2;                 //正在执行的指令信息(可无)
+    required Message_type               msg_type=1;                         //消息类型
+    optional Command_message            cmd_msg=2;                          //正在执行的指令信息(可无)
     required Lidar_statu                dj_statu1=3;                       //大疆测量雷达1连接状态
     required Lidar_statu                dj_statu2=4;                       //大疆测量雷达2连接状态
     required Lidar_statu                dj_statu3=5;                       //大疆测量雷达3连接状态
@@ -30,16 +30,16 @@ enum Locate_type
 //定位请求消息
 message Locate_request_msg
 {
-    required Message_type               msg_type=1;         //消息类型
-    required Command_message            cmd_msg=2;                 //指令信息
+    required Message_type               msg_type=1;                         //消息类型
+    required Command_message            cmd_msg=2;                          //指令信息
     required Locate_type                locate_type=3;
-    optional int32                      time_out=4 [default=5000];           //定位测量超时设置
+    optional int32                      time_out=4 [default=5000];          //定位测量超时设置
 }
 
 //定位测量返回消息
 message Locate_response_msg
 {
-    required Message_type               msg_type=1;         //消息类型
+    required Message_type               msg_type=1;                         //消息类型
     required Command_message            cmd_msg=2;
     required int32                      error_code=3;
     optional string                     error_description=4;
@@ -50,7 +50,6 @@ message Locate_response_msg
     optional float                      x=9;
     optional float                      y=10;
     optional float                      theta=11;
-
 }
 
 

+ 337 - 51
message/message_base.pb.cc

@@ -20,6 +20,11 @@
 #endif
 // @@protoc_insertion_point(includes)
 namespace message {
+class Base_msgDefaultTypeInternal {
+ public:
+  ::google::protobuf::internal::ExplicitlyConstructed<Base_msg>
+      _instance;
+} _Base_msg_default_instance_;
 class Command_messageDefaultTypeInternal {
  public:
   ::google::protobuf::internal::ExplicitlyConstructed<Command_message>
@@ -27,6 +32,27 @@ class Command_messageDefaultTypeInternal {
 } _Command_message_default_instance_;
 }  // namespace message
 namespace protobuf_message_5fbase_2eproto {
+void InitDefaultsBase_msgImpl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
+#else
+  ::google::protobuf::internal::InitProtobufDefaults();
+#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
+  {
+    void* ptr = &::message::_Base_msg_default_instance_;
+    new (ptr) ::message::Base_msg();
+    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::message::Base_msg::InitAsDefaultInstance();
+}
+
+void InitDefaultsBase_msg() {
+  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
+  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsBase_msgImpl);
+}
+
 void InitDefaultsCommand_messageImpl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
@@ -48,10 +74,17 @@ void InitDefaultsCommand_message() {
   ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsCommand_messageImpl);
 }
 
-::google::protobuf::Metadata file_level_metadata[1];
+::google::protobuf::Metadata file_level_metadata[2];
 const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
 
 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _has_bits_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Base_msg, msg_type_),
+  0,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -62,17 +95,19 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, act_type_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, from_id_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Command_message, destination_id_),
-  4,
   0,
   1,
   2,
   3,
+  4,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 10, sizeof(::message::Command_message)},
+  { 0, 6, sizeof(::message::Base_msg)},
+  { 7, 17, sizeof(::message::Command_message)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Base_msg_default_instance_),
   reinterpret_cast<const ::google::protobuf::Message*>(&::message::_Command_message_default_instance_),
 };
 
@@ -92,26 +127,28 @@ void protobuf_AssignDescriptorsOnce() {
 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
 void protobuf_RegisterTypes(const ::std::string&) {
   protobuf_AssignDescriptorsOnce();
-  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
+  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
 }
 
 void AddDescriptorsImpl() {
   InitDefaults();
   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\022message_base.proto\022\007message\"\237\001\n\017Comman"
-      "d_message\022\'\n\010msg_type\030\001 \002(\0162\025.message.Me"
-      "ssage_type\022\022\n\ncommand_id\030\002 \002(\005\022&\n\010act_ty"
-      "pe\030\003 \002(\0162\024.message.Action_type\022\017\n\007from_i"
-      "d\030\004 \002(\005\022\026\n\016destination_id\030\005 \002(\005*\270\001\n\014Mess"
-      "age_type\022\020\n\014eCommand_msg\020\001\022\026\n\022eLocate_st"
-      "atus_msg\020\021\022\027\n\023eLocate_request_msg\020\022\022\030\n\024e"
-      "Locate_response_msg\020\023\022\026\n\022eHarware_statu_"
-      "msg\020!\022\030\n\024eExecute_request_msg\020\"\022\031\n\025eExec"
-      "ute_response_msg\020#*#\n\013Action_type\022\t\n\005ePa"
-      "rk\020\000\022\t\n\005ePick\020\001"
+      "\n\022message_base.proto\022\007message\"3\n\010Base_ms"
+      "g\022\'\n\010msg_type\030\001 \002(\0162\025.message.Message_ty"
+      "pe\"\237\001\n\017Command_message\022\'\n\010msg_type\030\001 \002(\016"
+      "2\025.message.Message_type\022\022\n\ncommand_id\030\002 "
+      "\002(\005\022&\n\010act_type\030\003 \002(\0162\024.message.Action_t"
+      "ype\022\017\n\007from_id\030\004 \002(\005\022\026\n\016destination_id\030\005"
+      " \002(\005*\307\001\n\014Message_type\022\r\n\teBase_msg\020\000\022\020\n\014"
+      "eCommand_msg\020\001\022\026\n\022eLocate_status_msg\020\021\022\027"
+      "\n\023eLocate_request_msg\020\022\022\030\n\024eLocate_respo"
+      "nse_msg\020\023\022\026\n\022eHarware_statu_msg\020!\022\030\n\024eEx"
+      "ecute_request_msg\020\"\022\031\n\025eExecute_response"
+      "_msg\020#*#\n\013Action_type\022\t\n\005ePark\020\000\022\t\n\005ePic"
+      "k\020\001"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 415);
+      descriptor, 483);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "message_base.proto", &protobuf_RegisterTypes);
 }
@@ -134,6 +171,7 @@ const ::google::protobuf::EnumDescriptor* Message_type_descriptor() {
 }
 bool Message_type_IsValid(int value) {
   switch (value) {
+    case 0:
     case 1:
     case 17:
     case 18:
@@ -162,6 +200,256 @@ bool Action_type_IsValid(int value) {
 }
 
 
+// ===================================================================
+
+void Base_msg::InitAsDefaultInstance() {
+}
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+const int Base_msg::kMsgTypeFieldNumber;
+#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
+
+Base_msg::Base_msg()
+  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
+  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
+    ::protobuf_message_5fbase_2eproto::InitDefaultsBase_msg();
+  }
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:message.Base_msg)
+}
+Base_msg::Base_msg(const Base_msg& from)
+  : ::google::protobuf::Message(),
+      _internal_metadata_(NULL),
+      _has_bits_(from._has_bits_),
+      _cached_size_(0) {
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  msg_type_ = from.msg_type_;
+  // @@protoc_insertion_point(copy_constructor:message.Base_msg)
+}
+
+void Base_msg::SharedCtor() {
+  _cached_size_ = 0;
+  msg_type_ = 0;
+}
+
+Base_msg::~Base_msg() {
+  // @@protoc_insertion_point(destructor:message.Base_msg)
+  SharedDtor();
+}
+
+void Base_msg::SharedDtor() {
+}
+
+void Base_msg::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Base_msg::descriptor() {
+  ::protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
+}
+
+const Base_msg& Base_msg::default_instance() {
+  ::protobuf_message_5fbase_2eproto::InitDefaultsBase_msg();
+  return *internal_default_instance();
+}
+
+Base_msg* Base_msg::New(::google::protobuf::Arena* arena) const {
+  Base_msg* n = new Base_msg;
+  if (arena != NULL) {
+    arena->Own(n);
+  }
+  return n;
+}
+
+void Base_msg::Clear() {
+// @@protoc_insertion_point(message_clear_start:message.Base_msg)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  msg_type_ = 0;
+  _has_bits_.Clear();
+  _internal_metadata_.Clear();
+}
+
+bool Base_msg::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:message.Base_msg)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .message.Message_type msg_type = 1;
+      case 1: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (::message::Message_type_IsValid(value)) {
+            set_msg_type(static_cast< ::message::Message_type >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(
+                1, static_cast< ::google::protobuf::uint64>(value));
+          }
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      default: {
+      handle_unusual:
+        if (tag == 0) {
+          goto success;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, _internal_metadata_.mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:message.Base_msg)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:message.Base_msg)
+  return false;
+#undef DO_
+}
+
+void Base_msg::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:message.Base_msg)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      1, this->msg_type(), output);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        _internal_metadata_.unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:message.Base_msg)
+}
+
+::google::protobuf::uint8* Base_msg::InternalSerializeWithCachedSizesToArray(
+    bool deterministic, ::google::protobuf::uint8* target) const {
+  (void)deterministic; // Unused
+  // @@protoc_insertion_point(serialize_to_array_start:message.Base_msg)
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .message.Message_type msg_type = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      1, this->msg_type(), target);
+  }
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:message.Base_msg)
+  return target;
+}
+
+size_t Base_msg::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:message.Base_msg)
+  size_t total_size = 0;
+
+  if (_internal_metadata_.have_unknown_fields()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        _internal_metadata_.unknown_fields());
+  }
+  // required .message.Message_type msg_type = 1;
+  if (has_msg_type()) {
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = cached_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Base_msg::MergeFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:message.Base_msg)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Base_msg* source =
+      ::google::protobuf::internal::DynamicCastToGenerated<const Base_msg>(
+          &from);
+  if (source == NULL) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Base_msg)
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Base_msg)
+    MergeFrom(*source);
+  }
+}
+
+void Base_msg::MergeFrom(const Base_msg& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:message.Base_msg)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom(from._internal_metadata_);
+  ::google::protobuf::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from.has_msg_type()) {
+    set_msg_type(from.msg_type());
+  }
+}
+
+void Base_msg::CopyFrom(const ::google::protobuf::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:message.Base_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Base_msg::CopyFrom(const Base_msg& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:message.Base_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Base_msg::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  return true;
+}
+
+void Base_msg::Swap(Base_msg* other) {
+  if (other == this) return;
+  InternalSwap(other);
+}
+void Base_msg::InternalSwap(Base_msg* other) {
+  using std::swap;
+  swap(msg_type_, other->msg_type_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  _internal_metadata_.Swap(&other->_internal_metadata_);
+  swap(_cached_size_, other->_cached_size_);
+}
+
+::google::protobuf::Metadata Base_msg::GetMetadata() const {
+  protobuf_message_5fbase_2eproto::protobuf_AssignDescriptorsOnce();
+  return ::protobuf_message_5fbase_2eproto::file_level_metadata[kIndexInFileMessages];
+}
+
+
 // ===================================================================
 
 void Command_message::InitAsDefaultInstance() {
@@ -188,18 +476,17 @@ Command_message::Command_message(const Command_message& from)
       _has_bits_(from._has_bits_),
       _cached_size_(0) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&command_id_, &from.command_id_,
-    static_cast<size_t>(reinterpret_cast<char*>(&msg_type_) -
-    reinterpret_cast<char*>(&command_id_)) + sizeof(msg_type_));
+  ::memcpy(&msg_type_, &from.msg_type_,
+    static_cast<size_t>(reinterpret_cast<char*>(&destination_id_) -
+    reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
   // @@protoc_insertion_point(copy_constructor:message.Command_message)
 }
 
 void Command_message::SharedCtor() {
   _cached_size_ = 0;
-  ::memset(&command_id_, 0, static_cast<size_t>(
+  ::memset(&msg_type_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&destination_id_) -
-      reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
-  msg_type_ = 1;
+      reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
 }
 
 Command_message::~Command_message() {
@@ -241,10 +528,9 @@ void Command_message::Clear() {
 
   cached_has_bits = _has_bits_[0];
   if (cached_has_bits & 31u) {
-    ::memset(&command_id_, 0, static_cast<size_t>(
+    ::memset(&msg_type_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&destination_id_) -
-        reinterpret_cast<char*>(&command_id_)) + sizeof(destination_id_));
-    msg_type_ = 1;
+        reinterpret_cast<char*>(&msg_type_)) + sizeof(destination_id_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -370,29 +656,29 @@ void Command_message::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000001u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       1, this->msg_type(), output);
   }
 
   // required int32 command_id = 2;
-  if (cached_has_bits & 0x00000001u) {
+  if (cached_has_bits & 0x00000002u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->command_id(), output);
   }
 
   // required .message.Action_type act_type = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     ::google::protobuf::internal::WireFormatLite::WriteEnum(
       3, this->act_type(), output);
   }
 
   // required int32 from_id = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->from_id(), output);
   }
 
   // required int32 destination_id = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->destination_id(), output);
   }
 
@@ -412,29 +698,29 @@ void Command_message::SerializeWithCachedSizes(
 
   cached_has_bits = _has_bits_[0];
   // required .message.Message_type msg_type = 1;
-  if (cached_has_bits & 0x00000010u) {
+  if (cached_has_bits & 0x00000001u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       1, this->msg_type(), target);
   }
 
   // required int32 command_id = 2;
-  if (cached_has_bits & 0x00000001u) {
+  if (cached_has_bits & 0x00000002u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->command_id(), target);
   }
 
   // required .message.Action_type act_type = 3;
-  if (cached_has_bits & 0x00000002u) {
+  if (cached_has_bits & 0x00000004u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
       3, this->act_type(), target);
   }
 
   // required int32 from_id = 4;
-  if (cached_has_bits & 0x00000004u) {
+  if (cached_has_bits & 0x00000008u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->from_id(), target);
   }
 
   // required int32 destination_id = 5;
-  if (cached_has_bits & 0x00000008u) {
+  if (cached_has_bits & 0x00000010u) {
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->destination_id(), target);
   }
 
@@ -450,6 +736,12 @@ size_t Command_message::RequiredFieldsByteSizeFallback() const {
 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Command_message)
   size_t total_size = 0;
 
+  if (has_msg_type()) {
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+  }
+
   if (has_command_id()) {
     // required int32 command_id = 2;
     total_size += 1 +
@@ -477,12 +769,6 @@ size_t Command_message::RequiredFieldsByteSizeFallback() const {
         this->destination_id());
   }
 
-  if (has_msg_type()) {
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-  }
-
   return total_size;
 }
 size_t Command_message::ByteSizeLong() const {
@@ -495,6 +781,10 @@ size_t Command_message::ByteSizeLong() const {
         _internal_metadata_.unknown_fields());
   }
   if (((_has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) {  // All required fields are present.
+    // required .message.Message_type msg_type = 1;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
+
     // required int32 command_id = 2;
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::Int32Size(
@@ -514,10 +804,6 @@ size_t Command_message::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->destination_id());
 
-    // required .message.Message_type msg_type = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::EnumSize(this->msg_type());
-
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -553,19 +839,19 @@ void Command_message::MergeFrom(const Command_message& from) {
   cached_has_bits = from._has_bits_[0];
   if (cached_has_bits & 31u) {
     if (cached_has_bits & 0x00000001u) {
-      command_id_ = from.command_id_;
+      msg_type_ = from.msg_type_;
     }
     if (cached_has_bits & 0x00000002u) {
-      act_type_ = from.act_type_;
+      command_id_ = from.command_id_;
     }
     if (cached_has_bits & 0x00000004u) {
-      from_id_ = from.from_id_;
+      act_type_ = from.act_type_;
     }
     if (cached_has_bits & 0x00000008u) {
-      destination_id_ = from.destination_id_;
+      from_id_ = from.from_id_;
     }
     if (cached_has_bits & 0x00000010u) {
-      msg_type_ = from.msg_type_;
+      destination_id_ = from.destination_id_;
     }
     _has_bits_[0] |= cached_has_bits;
   }
@@ -596,11 +882,11 @@ void Command_message::Swap(Command_message* other) {
 }
 void Command_message::InternalSwap(Command_message* other) {
   using std::swap;
+  swap(msg_type_, other->msg_type_);
   swap(command_id_, other->command_id_);
   swap(act_type_, other->act_type_);
   swap(from_id_, other->from_id_);
   swap(destination_id_, other->destination_id_);
-  swap(msg_type_, other->msg_type_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
   swap(_cached_size_, other->_cached_size_);

+ 175 - 27
message/message_base.pb.h

@@ -37,19 +37,25 @@ namespace protobuf_message_5fbase_2eproto {
 struct TableStruct {
   static const ::google::protobuf::internal::ParseTableField entries[];
   static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  static const ::google::protobuf::internal::ParseTable schema[1];
+  static const ::google::protobuf::internal::ParseTable schema[2];
   static const ::google::protobuf::internal::FieldMetadata field_metadata[];
   static const ::google::protobuf::internal::SerializationTable serialization_table[];
   static const ::google::protobuf::uint32 offsets[];
 };
 void AddDescriptors();
+void InitDefaultsBase_msgImpl();
+void InitDefaultsBase_msg();
 void InitDefaultsCommand_messageImpl();
 void InitDefaultsCommand_message();
 inline void InitDefaults() {
+  InitDefaultsBase_msg();
   InitDefaultsCommand_message();
 }
 }  // namespace protobuf_message_5fbase_2eproto
 namespace message {
+class Base_msg;
+class Base_msgDefaultTypeInternal;
+extern Base_msgDefaultTypeInternal _Base_msg_default_instance_;
 class Command_message;
 class Command_messageDefaultTypeInternal;
 extern Command_messageDefaultTypeInternal _Command_message_default_instance_;
@@ -57,6 +63,7 @@ extern Command_messageDefaultTypeInternal _Command_message_default_instance_;
 namespace message {
 
 enum Message_type {
+  eBase_msg = 0,
   eCommand_msg = 1,
   eLocate_status_msg = 17,
   eLocate_request_msg = 18,
@@ -66,7 +73,7 @@ enum Message_type {
   eExecute_response_msg = 35
 };
 bool Message_type_IsValid(int value);
-const Message_type Message_type_MIN = eCommand_msg;
+const Message_type Message_type_MIN = eBase_msg;
 const Message_type Message_type_MAX = eExecute_response_msg;
 const int Message_type_ARRAYSIZE = Message_type_MAX + 1;
 
@@ -101,6 +108,116 @@ inline bool Action_type_Parse(
 }
 // ===================================================================
 
+class Base_msg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Base_msg) */ {
+ public:
+  Base_msg();
+  virtual ~Base_msg();
+
+  Base_msg(const Base_msg& from);
+
+  inline Base_msg& operator=(const Base_msg& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  #if LANG_CXX11
+  Base_msg(Base_msg&& from) noexcept
+    : Base_msg() {
+    *this = ::std::move(from);
+  }
+
+  inline Base_msg& operator=(Base_msg&& from) noexcept {
+    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+  #endif
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields();
+  }
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields();
+  }
+
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const Base_msg& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Base_msg* internal_default_instance() {
+    return reinterpret_cast<const Base_msg*>(
+               &_Base_msg_default_instance_);
+  }
+  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
+    0;
+
+  void Swap(Base_msg* other);
+  friend void swap(Base_msg& a, Base_msg& b) {
+    a.Swap(&b);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Base_msg* New() const PROTOBUF_FINAL { return New(NULL); }
+
+  Base_msg* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
+  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
+  void CopyFrom(const Base_msg& from);
+  void MergeFrom(const Base_msg& from);
+  void Clear() PROTOBUF_FINAL;
+  bool IsInitialized() const PROTOBUF_FINAL;
+
+  size_t ByteSizeLong() const PROTOBUF_FINAL;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
+  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
+      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
+  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const PROTOBUF_FINAL;
+  void InternalSwap(Base_msg* other);
+  private:
+  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+    return NULL;
+  }
+  inline void* MaybeArenaPtr() const {
+    return NULL;
+  }
+  public:
+
+  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
+  // @@protoc_insertion_point(class_scope:message.Base_msg)
+ private:
+  void set_has_msg_type();
+  void clear_has_msg_type();
+
+  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+  ::google::protobuf::internal::HasBits<1> _has_bits_;
+  mutable int _cached_size_;
+  int msg_type_;
+  friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
+  friend void ::protobuf_message_5fbase_2eproto::InitDefaultsBase_msgImpl();
+};
+// -------------------------------------------------------------------
+
 class Command_message : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Command_message) */ {
  public:
   Command_message();
@@ -143,7 +260,7 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
                &_Command_message_default_instance_);
   }
   static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
+    1;
 
   void Swap(Command_message* other);
   friend void swap(Command_message& a, Command_message& b) {
@@ -190,6 +307,13 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
 
   // accessors -------------------------------------------------------
 
+  // required .message.Message_type msg_type = 1;
+  bool has_msg_type() const;
+  void clear_msg_type();
+  static const int kMsgTypeFieldNumber = 1;
+  ::message::Message_type msg_type() const;
+  void set_msg_type(::message::Message_type value);
+
   // required int32 command_id = 2;
   bool has_command_id() const;
   void clear_command_id();
@@ -218,13 +342,6 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
   ::google::protobuf::int32 destination_id() const;
   void set_destination_id(::google::protobuf::int32 value);
 
-  // required .message.Message_type msg_type = 1;
-  bool has_msg_type() const;
-  void clear_msg_type();
-  static const int kMsgTypeFieldNumber = 1;
-  ::message::Message_type msg_type() const;
-  void set_msg_type(::message::Message_type value);
-
   // @@protoc_insertion_point(class_scope:message.Command_message)
  private:
   void set_has_msg_type();
@@ -244,11 +361,11 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
+  int msg_type_;
   ::google::protobuf::int32 command_id_;
   int act_type_;
   ::google::protobuf::int32 from_id_;
   ::google::protobuf::int32 destination_id_;
-  int msg_type_;
   friend struct ::protobuf_message_5fbase_2eproto::TableStruct;
   friend void ::protobuf_message_5fbase_2eproto::InitDefaultsCommand_messageImpl();
 };
@@ -261,20 +378,49 @@ class Command_message : public ::google::protobuf::Message /* @@protoc_insertion
   #pragma GCC diagnostic push
   #pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #endif  // __GNUC__
+// Base_msg
+
+// required .message.Message_type msg_type = 1;
+inline bool Base_msg::has_msg_type() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Base_msg::set_has_msg_type() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Base_msg::clear_has_msg_type() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Base_msg::clear_msg_type() {
+  msg_type_ = 0;
+  clear_has_msg_type();
+}
+inline ::message::Message_type Base_msg::msg_type() const {
+  // @@protoc_insertion_point(field_get:message.Base_msg.msg_type)
+  return static_cast< ::message::Message_type >(msg_type_);
+}
+inline void Base_msg::set_msg_type(::message::Message_type value) {
+  assert(::message::Message_type_IsValid(value));
+  set_has_msg_type();
+  msg_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Base_msg.msg_type)
+}
+
+// -------------------------------------------------------------------
+
 // Command_message
 
 // required .message.Message_type msg_type = 1;
 inline bool Command_message::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000001u) != 0;
 }
 inline void Command_message::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000001u;
 }
 inline void Command_message::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000001u;
 }
 inline void Command_message::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Command_message::msg_type() const {
@@ -290,13 +436,13 @@ inline void Command_message::set_msg_type(::message::Message_type value) {
 
 // required int32 command_id = 2;
 inline bool Command_message::has_command_id() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
+  return (_has_bits_[0] & 0x00000002u) != 0;
 }
 inline void Command_message::set_has_command_id() {
-  _has_bits_[0] |= 0x00000001u;
+  _has_bits_[0] |= 0x00000002u;
 }
 inline void Command_message::clear_has_command_id() {
-  _has_bits_[0] &= ~0x00000001u;
+  _has_bits_[0] &= ~0x00000002u;
 }
 inline void Command_message::clear_command_id() {
   command_id_ = 0;
@@ -314,13 +460,13 @@ inline void Command_message::set_command_id(::google::protobuf::int32 value) {
 
 // required .message.Action_type act_type = 3;
 inline bool Command_message::has_act_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Command_message::set_has_act_type() {
-  _has_bits_[0] |= 0x00000002u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Command_message::clear_has_act_type() {
-  _has_bits_[0] &= ~0x00000002u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Command_message::clear_act_type() {
   act_type_ = 0;
@@ -339,13 +485,13 @@ inline void Command_message::set_act_type(::message::Action_type value) {
 
 // required int32 from_id = 4;
 inline bool Command_message::has_from_id() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Command_message::set_has_from_id() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Command_message::clear_has_from_id() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Command_message::clear_from_id() {
   from_id_ = 0;
@@ -363,13 +509,13 @@ inline void Command_message::set_from_id(::google::protobuf::int32 value) {
 
 // required int32 destination_id = 5;
 inline bool Command_message::has_destination_id() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000010u) != 0;
 }
 inline void Command_message::set_has_destination_id() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000010u;
 }
 inline void Command_message::clear_has_destination_id() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000010u;
 }
 inline void Command_message::clear_destination_id() {
   destination_id_ = 0;
@@ -388,6 +534,8 @@ inline void Command_message::set_destination_id(::google::protobuf::int32 value)
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
+// -------------------------------------------------------------------
+
 
 // @@protoc_insertion_point(namespace_scope)
 

+ 7 - 0
message/message_base.proto

@@ -4,6 +4,7 @@ package message;
 //消息类型定义,每个在网络上传输的消息必须含有这个属性
 enum Message_type
 {
+    eBase_msg=0x00;
     eCommand_msg=0x01;                      //指令消息
 
 
@@ -17,7 +18,13 @@ enum Message_type
     eExecute_response_msg=0x23;             //调度结果反馈消息
 
 }
+////base message 用于解析未知类型的消息
+message Base_msg
+{
+    required Message_type msg_type=1;
+}
 
+//指令类型
 enum Action_type
 {
     ePark=0;