Browse Source

20200630, 优化communication通信

huli 4 years ago
parent
commit
afca1f12ee

+ 0 - 2
CMakeLists.txt

@@ -45,8 +45,6 @@ aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
 add_executable(terminal
         main.cpp
         ./error_code/error_code.cpp
-        ./nnxx/nnxx_client.cpp
-        setting.pb.cc
         ${locate_src}
         ${robot_src}
         ${message_src}

+ 21 - 16
communication/communication_socket_base.cpp

@@ -255,7 +255,6 @@ void Communication_socket_base::receive_data_thread()
 					//第一次解析之后转化为, Communication_message, 自定义的通信消息格式
 					Communication_message  * tp_communication_message = new Communication_message;
 					tp_communication_message->reset(t_base_msg, t_receive_string);
-
 					//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
 					if ( check_msg(tp_communication_message) == SUCCESS )
 					{
@@ -298,8 +297,8 @@ Error_manager Communication_socket_base::check_msg(Communication_message*  p_msg
 {
 	//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 判断这条消息是不是给我的.
 	//子类重载时, 增加自己模块的判断逻辑, 以后再写.
-	if ( p_msg->get_message_type() == Communication_message::Message_type::eLocate_request_msg
-		 && p_msg->get_receiver() == Communication_message::Communicator::eMeasurer )
+	if ( p_msg->get_message_type() == Communication_message::Message_type::eBase_msg
+		 && p_msg->get_receiver() == Communication_message::Communicator::eMain )
 	{
 		return Error_code::SUCCESS;
 	}
@@ -414,6 +413,9 @@ Error_manager Communication_socket_base::check_executer(Communication_message*
 
 	if ( p_msg->is_over_time() )
 	{
+		std::cout << "Communication_socket_base::check_msg  p_buf =  " << p_msg->get_message_buf() << std::endl;
+		std::cout << "Communication_socket_base::check_msg   size =  " << p_msg->get_message_buf().size() << std::endl;
+		std::cout << "COMMUNICATION_ANALYSIS_TIME_OUT , " << std::endl;
 		return Error_code::COMMUNICATION_ANALYSIS_TIME_OUT;
 	}
 	else
@@ -421,7 +423,7 @@ Error_manager Communication_socket_base::check_executer(Communication_message*
 		bool executer_is_ready = false;
 		//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 找到处理模块的实例对象, 查询执行人是否可以处理这条消息
 		//这里子类重载时, 增加判断逻辑, 以后再写.
-		executer_is_ready = true;
+//		executer_is_ready = true;
 
 		std::cout << "Communication_socket_base::check_msg  p_buf =  " << p_msg->get_message_buf() << std::endl;
 		std::cout << "Communication_socket_base::check_msg   size =  " << p_msg->get_message_buf().size() << std::endl;
@@ -484,7 +486,7 @@ void Communication_socket_base::send_data_thread()
 				if ( tp_msg != NULL )
 				{
 					std::unique_lock<std::mutex> lk(m_mutex);
-					m_socket.send(tp_msg->get_message_buf());
+					int send_size = m_socket.send(tp_msg->get_message_buf());
 					delete(tp_msg);
 					tp_msg = NULL;
 				}
@@ -536,23 +538,26 @@ void Communication_socket_base::encapsulate_data_thread()
 //定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
 Error_manager Communication_socket_base::encapsulate_send_data()
 {
-	char buf[256] = {0};
-	static unsigned int t_heartbeat = 0;
-	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0, test\0", t_heartbeat);
-	t_heartbeat++;
-
-	Communication_message* tp_msg = new Communication_message(buf, 100);
+//	char buf[256] = {0};
+//	static unsigned int t_heartbeat = 0;
+//	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0, test\0", t_heartbeat);
+//	t_heartbeat++;
+
+	message::Base_msg t_base_msg;
+	t_base_msg.set_msg_type(message::Message_type::eBase_msg);
+	t_base_msg.set_timeout_ms(5000);
+	t_base_msg.set_sender(message::Communicator::eMain);
+	t_base_msg.set_receiver(message::Communicator::eMain);
+
+	Communication_message* tp_msg = new Communication_message(t_base_msg.SerializeAsString());
 	bool is_push = m_send_data_list.push(tp_msg);
 	if ( is_push == false )
 	{
+		delete(tp_msg);
+		tp_msg = NULL;
 		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
 							 " Communication_socket_base::encapsulate_msg error ");
 	}
-	else
-	{
-	    delete(tp_msg);
-		tp_msg = NULL;
-	}
 	return Error_code::SUCCESS;
 }
 

+ 0 - 78
lidar_locate/Locate_communicator.cpp

@@ -1,78 +0,0 @@
-//
-// Created by zx on 2020/6/18.
-//
-
-#include "Locate_communicator.h"
-//#include "locate_message.pb.h"
-
-
-Locate_communicator* Locate_communicator::mp_locate_communicator=NULL;
-
-Locate_communicator::Locate_communicator()
-{
-
-}
-Locate_communicator::~Locate_communicator()
-{
-
-}
-/*
-Error_manager Locate_communicator::locate_request(message::Locate_request_msg request,message::Locate_response_msg& result,unsigned int timeout)
-{
-
-    std::string response_string;
-    Error_manager code=m_nnxx_client.request(request.SerializeAsString(),response_string,timeout);
-
-    if(code==SUCCESS)
-    {
-        //解析返回数据
-        message::Locate_response_msg response;
-
-        if(false==response.ParseFromString(response_string))
-        {
-            //解析response数据错误,
-//            return Error_manager(LOCATE_RESPONSE_PARSE_ERROR,MAJOR_ERROR,"response string parse failed");
-        }
-        else if(response.error_manager().error_code()==SUCCESS)
-        {
-            result=response;
-            return SUCCESS;
-        }
-        else
-        {
-            ///将response中的错误信息,转换成错误码,返回
-            return Error_manager(Error_code(response.error_manager().error_code()),MAJOR_ERROR,response.error_manager().error_description().c_str());
-        }
-    }
-    else if(code.get_error_level()==MINOR_ERROR)
-    {
-        //处理底层处理不了的错误
-    }
-    else if(code.get_error_level()==MAJOR_ERROR)
-    {
-        //本模块功能失败的错误,向上抛出
-        return code;
-    }
-}
-*/
-Error_manager Locate_communicator::create_locate_communicator(std::string str_ip,int port)
-{
-    Error_manager code=SUCCESS;
-    if(mp_locate_communicator==NULL)
-    {
-        mp_locate_communicator=new Locate_communicator();
-        char connect_str[255]={0};
-        sprintf(connect_str,"tcp://%s:%d",str_ip.c_str(),port);
-        code=mp_locate_communicator->m_nnxx_client.connect(connect_str);
-        return code;
-    } else
-    {
-        return code;
-    }
-
-}
-
-Locate_communicator* Locate_communicator::get_instance()
-{
-    return mp_locate_communicator;
-}

+ 0 - 27
lidar_locate/Locate_communicator.h

@@ -1,27 +0,0 @@
-//
-// Created by zx on 2020/6/18.
-//
-
-#ifndef NNXX_TESTS_LOCATE_COMMUNICATOR_H
-#define NNXX_TESTS_LOCATE_COMMUNICATOR_H
-
-#include <mutex>
-#include "nnxx_client.h"
-//#include "locate_message.pb.h"
-#include "../message/measure_message.pb.h"
-#include "../error_code/error_code.h"
-
-class Locate_communicator {
-public:
-    virtual ~Locate_communicator();
-//    Error_manager locate_request(message::Locate_request_msg request,message::Locate_response_msg& result,unsigned int timeout=3000);
-    static Error_manager create_locate_communicator(std::string str_ip,int port);
-    static Locate_communicator* get_instance();
-protected:
-    Locate_communicator();
-    Client          m_nnxx_client;
-    static  Locate_communicator*  mp_locate_communicator;
-};
-
-
-#endif //NNXX_TESTS_LOCATE_COMMUNICATOR_H

+ 10 - 50
main.cpp

@@ -4,60 +4,20 @@
 
 #include <iostream>
 #include <glog/logging.h>
-#include "setting.pb.h"
-#include "lidar_locate/Locate_communicator.h"
 
-#include <fcntl.h>
-#include <google/protobuf/io/zero_copy_stream_impl.h>
-#include <google/protobuf/text_format.h>
-using google::protobuf::io::FileInputStream;
-using google::protobuf::io::FileOutputStream;
-using google::protobuf::io::ZeroCopyInputStream;
-using google::protobuf::io::CodedInputStream;
-using google::protobuf::io::ZeroCopyOutputStream;
-using google::protobuf::io::CodedOutputStream;
-using google::protobuf::Message;
-
-bool read_proto_param(std::string file, ::google::protobuf::Message& parameter)
-{
-    int fd = open(file.c_str(), O_RDONLY);
-    if (fd == -1) return false;
-    FileInputStream* input = new FileInputStream(fd);
-
-    bool success = google::protobuf::TextFormat::Parse(input, &parameter);
-    delete input;
-    close(fd);
-    return success;
-}
+#include "./communication/communication_socket_base.h"
 
 int main(int argc,char* argv[])
 {
-    //读取配置
-    ///
-    setting::global_setting parameter;
+	Communication_socket_base csb;
 
-    if(false==read_proto_param("",parameter))
-    {
-        LOG(ERROR)<<"read setting file failed";
-        return 0;
-    }
+//	std::vector<std::string> connect_string_vector;
+//	connect_string_vector.push_back("tcp://192.168.2.166:9001");
+//	csb.communication_init("tcp://192.168.2.166:9000", connect_string_vector);
 
-    //创建各个模块的通讯对象
-    setting::locate_setting locate_parameter=parameter.locate_parameter();
-    Error_manager code=Locate_communicator::create_locate_communicator(locate_parameter.ip(),locate_parameter.port());
-    if(code!=SUCCESS)
-    {
-        LOG(ERROR)<<code.to_string();
-    }
-    //测试各个模块
-//    message::Command_message cmd_msg;
-//    message::Locate_request_msg request;
-//    message::Locate_response_msg result;
-//
-//    code=Locate_communicator::get_instance()->locate_request(request,result);
-    if(code!=SUCCESS)
-    {
-        LOG(ERROR)<<code.to_string();
-    }
-    return 0;
+	csb.communication_init();
+
+	char ch ;
+	std::cin >> ch ;
+	return 0;
 }

+ 0 - 40
nnxx/nnxx_client.cpp

@@ -1,40 +0,0 @@
-//
-// Created by zx on 2020/6/10.
-//
-
-#include "nnxx_client.h"
-
-
-Client::Client()
-{
-    m_socket=nnxx::socket{ nnxx::SP, nnxx::REQ};
-}
-Client::~Client()
-{
-    std::lock_guard<std::mutex> lck (m_lock);
-    m_socket.close();
-}
-Error_manager Client::connect(std::string connect_str)
-{
-    std::lock_guard<std::mutex> lck (m_lock);
-    m_socket.connect(connect_str);
-    return SUCCESS;
-}
-Error_manager Client::request(std::string request_str, std::string& response,unsigned int timeout)
-{
-    std::lock_guard<std::mutex> lck (m_lock);
-    m_socket.send(request_str);
-
-    nnxx::message message;
-    try { nnxx::with_recv_timeout _ { m_socket, std::chrono::milliseconds(timeout) };
-        message=m_socket.recv();
-    }
-    catch (const nnxx::timeout_error &) {
-//        return Error_manager(NNXX_CLIENT_REQUEST_TIMEOUT,MINOR_ERROR,"nnxx client request timeout");
-    }
-    catch (const std::exception &) {
-//        return Error_manager(NNXX_CLIENT_REQUEST_UNKNOW,MINOR_ERROR,"nnxx client request unknow error");
-    }
-    response=nnxx::to_string(message);
-    return SUCCESS;
-}

+ 0 - 33
nnxx/nnxx_client.h

@@ -1,33 +0,0 @@
-//
-// Created by zx on 2020/6/10.
-//
-
-#ifndef NNXX_TESTS_CLIENT_H
-#define NNXX_TESTS_CLIENT_H
-
-#include <nnxx/message.h>
-#include <nnxx/message_control.h>
-#include <nnxx/socket.h>
-#include <nnxx/reqrep.h>
-#include <string>
-#include <iostream>
-
-#include <nnxx/timeout.h>
-#include <nnxx/error.h>
-#include "../error_code/error_code.h"
-#include <mutex>
-class Client {
-public:
-    Client();
-    virtual ~Client();
-    Error_manager connect(std::string connect_str);
-    virtual Error_manager request(std::string request_str, std::string& response,unsigned int timeout);
-
-protected:
-    bool    mb_connect;
-    nnxx::socket    m_socket;
-    std::mutex      m_lock;
-};
-
-
-#endif //NNXX_TESTS_CLIENT_H

+ 0 - 56
nnxx/nnxx_server.cpp

@@ -1,56 +0,0 @@
-//
-// Created by zx on 2020/6/10.
-//
-
-#include "nnxx_server.h"
-Server::Server()
-{
-    m_service_thread= nullptr;
-    m_socket=nnxx::socket{nnxx::SP_RAW, nnxx::REP};
-}
-
-Server::~Server()
-{
-    mb_close=true;
-    if(m_service_thread!= nullptr)
-    {
-        if(m_service_thread->joinable())
-        {
-            m_service_thread->join();
-        }
-        delete m_service_thread;
-        m_service_thread= nullptr;
-    }
-    m_socket.close();
-}
-
-bool Server::bind(std::string connect_str) {
-    m_socket.bind(connect_str);
-    mb_close=false;
-    m_service_thread=new std::thread(service_handle,this);
-}
-bool Server::service_response(nnxx::message& message,nnxx::message_control& c1)
-{
-    static int response_num=0;
-    std::string msg=to_string(message);
-    std::cout<<" recieve request : "<<msg<<"total response : "<<++response_num<<std::endl;
-    std::string response="response : ";
-    response+=msg;
-    m_socket.send(response.c_str(),response.length(),0,std::move(c1));
-}
-
-void Server::service_handle(Server* pServer)
-{
-    if(pServer== nullptr)
-        return;
-    nnxx::message_control msg_control;
-    while(pServer->mb_close==false)
-    {
-        //非阻塞式读取
-        nnxx::message msg = pServer->m_socket.recv(1, msg_control);
-        if(msg.size()!=0)
-            pServer->service_response(msg,msg_control);
-        std::this_thread::yield();
-    }
-}
-

+ 0 - 32
nnxx/nnxx_server.h

@@ -1,32 +0,0 @@
-//
-// Created by zx on 2020/6/10.
-//
-
-#ifndef NNXX_TESTS_NNXX_SERVER_H
-#define NNXX_TESTS_NNXX_SERVER_H
-
-#include <nnxx/message.h>
-#include <nnxx/message_control.h>
-#include <nnxx/socket.h>
-#include <nnxx/reqrep.h>
-#include <string>
-#include <iostream>
-#include <thread>
-
-class Server {
-public:
-    Server();
-    ~Server();
-    bool bind(std::string connect_str);
-    bool service_response(nnxx::message& message,nnxx::message_control& c1);
-protected:
-    static void service_handle(Server* pServer);
-protected:
-    std::thread*        m_service_thread;
-    nnxx::socket        m_socket;
-    bool                mb_close;
-
-};
-
-
-#endif //NNXX_TESTS_NNXX_SERVER_H

+ 0 - 744
setting.pb.cc

@@ -1,744 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: setting.proto
-
-#include "setting.pb.h"
-
-#include <algorithm>
-
-#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/stubs/port.h>
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/generated_message_reflection.h>
-#include <google/protobuf/reflection_ops.h>
-#include <google/protobuf/wire_format.h>
-// This is a temporary google only hack
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-#include "third_party/protobuf/version.h"
-#endif
-// @@protoc_insertion_point(includes)
-namespace setting {
-class locate_settingDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<locate_setting>
-      _instance;
-} _locate_setting_default_instance_;
-class global_settingDefaultTypeInternal {
- public:
-  ::google::protobuf::internal::ExplicitlyConstructed<global_setting>
-      _instance;
-} _global_setting_default_instance_;
-}  // namespace setting
-namespace protobuf_setting_2eproto {
-void InitDefaultslocate_settingImpl() {
-  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 = &::setting::_locate_setting_default_instance_;
-    new (ptr) ::setting::locate_setting();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::setting::locate_setting::InitAsDefaultInstance();
-}
-
-void InitDefaultslocate_setting() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultslocate_settingImpl);
-}
-
-void InitDefaultsglobal_settingImpl() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
-#else
-  ::google::protobuf::internal::InitProtobufDefaults();
-#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
-  protobuf_setting_2eproto::InitDefaultslocate_setting();
-  {
-    void* ptr = &::setting::_global_setting_default_instance_;
-    new (ptr) ::setting::global_setting();
-    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
-  }
-  ::setting::global_setting::InitAsDefaultInstance();
-}
-
-void InitDefaultsglobal_setting() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsglobal_settingImpl);
-}
-
-::google::protobuf::Metadata file_level_metadata[2];
-
-const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, ip_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::locate_setting, port_),
-  0,
-  1,
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _has_bits_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, _internal_metadata_),
-  ~0u,  // no _extensions_
-  ~0u,  // no _oneof_case_
-  ~0u,  // no _weak_field_map_
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::setting::global_setting, locate_parameter_),
-  0,
-};
-static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-  { 0, 7, sizeof(::setting::locate_setting)},
-  { 9, 15, sizeof(::setting::global_setting)},
-};
-
-static ::google::protobuf::Message const * const file_default_instances[] = {
-  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_locate_setting_default_instance_),
-  reinterpret_cast<const ::google::protobuf::Message*>(&::setting::_global_setting_default_instance_),
-};
-
-void protobuf_AssignDescriptors() {
-  AddDescriptors();
-  ::google::protobuf::MessageFactory* factory = NULL;
-  AssignDescriptors(
-      "setting.proto", schemas, file_default_instances, TableStruct::offsets, factory,
-      file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
-}
-
-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, 2);
-}
-
-void AddDescriptorsImpl() {
-  InitDefaults();
-  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
-      "\n\rsetting.proto\022\007setting\"*\n\016locate_setti"
-      "ng\022\n\n\002ip\030\001 \002(\t\022\014\n\004port\030\002 \002(\005\"C\n\016global_s"
-      "etting\0221\n\020locate_parameter\030\001 \002(\0132\027.setti"
-      "ng.locate_setting"
-  };
-  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 137);
-  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
-    "setting.proto", &protobuf_RegisterTypes);
-}
-
-void AddDescriptors() {
-  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
-  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
-}
-// Force AddDescriptors() to be called at dynamic initialization time.
-struct StaticDescriptorInitializer {
-  StaticDescriptorInitializer() {
-    AddDescriptors();
-  }
-} static_descriptor_initializer;
-}  // namespace protobuf_setting_2eproto
-namespace setting {
-
-// ===================================================================
-
-void locate_setting::InitAsDefaultInstance() {
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int locate_setting::kIpFieldNumber;
-const int locate_setting::kPortFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-locate_setting::locate_setting()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_setting_2eproto::InitDefaultslocate_setting();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:setting.locate_setting)
-}
-locate_setting::locate_setting(const locate_setting& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ip_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  if (from.has_ip()) {
-    ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_);
-  }
-  port_ = from.port_;
-  // @@protoc_insertion_point(copy_constructor:setting.locate_setting)
-}
-
-void locate_setting::SharedCtor() {
-  _cached_size_ = 0;
-  ip_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  port_ = 0;
-}
-
-locate_setting::~locate_setting() {
-  // @@protoc_insertion_point(destructor:setting.locate_setting)
-  SharedDtor();
-}
-
-void locate_setting::SharedDtor() {
-  ip_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-
-void locate_setting::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* locate_setting::descriptor() {
-  ::protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const locate_setting& locate_setting::default_instance() {
-  ::protobuf_setting_2eproto::InitDefaultslocate_setting();
-  return *internal_default_instance();
-}
-
-locate_setting* locate_setting::New(::google::protobuf::Arena* arena) const {
-  locate_setting* n = new locate_setting;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void locate_setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:setting.locate_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(!ip_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
-    (*ip_.UnsafeRawStringPointer())->clear();
-  }
-  port_ = 0;
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool locate_setting::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:setting.locate_setting)
-  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 string ip = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_ip()));
-          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-            this->ip().data(), static_cast<int>(this->ip().length()),
-            ::google::protobuf::internal::WireFormat::PARSE,
-            "setting.locate_setting.ip");
-        } else {
-          goto handle_unusual;
-        }
-        break;
-      }
-
-      // required int32 port = 2;
-      case 2: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
-          set_has_port();
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &port_)));
-        } 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:setting.locate_setting)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:setting.locate_setting)
-  return false;
-#undef DO_
-}
-
-void locate_setting::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:setting.locate_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string ip = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ip().data(), static_cast<int>(this->ip().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "setting.locate_setting.ip");
-    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->ip(), output);
-  }
-
-  // required int32 port = 2;
-  if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->port(), output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:setting.locate_setting)
-}
-
-::google::protobuf::uint8* locate_setting::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:setting.locate_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required string ip = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
-      this->ip().data(), static_cast<int>(this->ip().length()),
-      ::google::protobuf::internal::WireFormat::SERIALIZE,
-      "setting.locate_setting.ip");
-    target =
-      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
-        1, this->ip(), target);
-  }
-
-  // required int32 port = 2;
-  if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->port(), 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:setting.locate_setting)
-  return target;
-}
-
-size_t locate_setting::RequiredFieldsByteSizeFallback() const {
-// @@protoc_insertion_point(required_fields_byte_size_fallback_start:setting.locate_setting)
-  size_t total_size = 0;
-
-  if (has_ip()) {
-    // required string ip = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->ip());
-  }
-
-  if (has_port()) {
-    // required int32 port = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->port());
-  }
-
-  return total_size;
-}
-size_t locate_setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:setting.locate_setting)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
-    // required string ip = 1;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->ip());
-
-    // required int32 port = 2;
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::Int32Size(
-        this->port());
-
-  } else {
-    total_size += RequiredFieldsByteSizeFallback();
-  }
-  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 locate_setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:setting.locate_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  const locate_setting* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const locate_setting>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.locate_setting)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.locate_setting)
-    MergeFrom(*source);
-  }
-}
-
-void locate_setting::MergeFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:setting.locate_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 3u) {
-    if (cached_has_bits & 0x00000001u) {
-      set_has_ip();
-      ip_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.ip_);
-    }
-    if (cached_has_bits & 0x00000002u) {
-      port_ = from.port_;
-    }
-    _has_bits_[0] |= cached_has_bits;
-  }
-}
-
-void locate_setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:setting.locate_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void locate_setting::CopyFrom(const locate_setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:setting.locate_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool locate_setting::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-  return true;
-}
-
-void locate_setting::Swap(locate_setting* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void locate_setting::InternalSwap(locate_setting* other) {
-  using std::swap;
-  ip_.Swap(&other->ip_);
-  swap(port_, other->port_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata locate_setting::GetMetadata() const {
-  protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// ===================================================================
-
-void global_setting::InitAsDefaultInstance() {
-  ::setting::_global_setting_default_instance_._instance.get_mutable()->locate_parameter_ = const_cast< ::setting::locate_setting*>(
-      ::setting::locate_setting::internal_default_instance());
-}
-#if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int global_setting::kLocateParameterFieldNumber;
-#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
-
-global_setting::global_setting()
-  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
-  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
-    ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
-  }
-  SharedCtor();
-  // @@protoc_insertion_point(constructor:setting.global_setting)
-}
-global_setting::global_setting(const global_setting& from)
-  : ::google::protobuf::Message(),
-      _internal_metadata_(NULL),
-      _has_bits_(from._has_bits_),
-      _cached_size_(0) {
-  _internal_metadata_.MergeFrom(from._internal_metadata_);
-  if (from.has_locate_parameter()) {
-    locate_parameter_ = new ::setting::locate_setting(*from.locate_parameter_);
-  } else {
-    locate_parameter_ = NULL;
-  }
-  // @@protoc_insertion_point(copy_constructor:setting.global_setting)
-}
-
-void global_setting::SharedCtor() {
-  _cached_size_ = 0;
-  locate_parameter_ = NULL;
-}
-
-global_setting::~global_setting() {
-  // @@protoc_insertion_point(destructor:setting.global_setting)
-  SharedDtor();
-}
-
-void global_setting::SharedDtor() {
-  if (this != internal_default_instance()) delete locate_parameter_;
-}
-
-void global_setting::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const ::google::protobuf::Descriptor* global_setting::descriptor() {
-  ::protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
-}
-
-const global_setting& global_setting::default_instance() {
-  ::protobuf_setting_2eproto::InitDefaultsglobal_setting();
-  return *internal_default_instance();
-}
-
-global_setting* global_setting::New(::google::protobuf::Arena* arena) const {
-  global_setting* n = new global_setting;
-  if (arena != NULL) {
-    arena->Own(n);
-  }
-  return n;
-}
-
-void global_setting::Clear() {
-// @@protoc_insertion_point(message_clear_start:setting.global_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  // Prevent compiler warnings about cached_has_bits being unused
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(locate_parameter_ != NULL);
-    locate_parameter_->Clear();
-  }
-  _has_bits_.Clear();
-  _internal_metadata_.Clear();
-}
-
-bool global_setting::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:setting.global_setting)
-  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 .setting.locate_setting locate_parameter = 1;
-      case 1: {
-        if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
-               input, mutable_locate_parameter()));
-        } 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:setting.global_setting)
-  return true;
-failure:
-  // @@protoc_insertion_point(parse_failure:setting.global_setting)
-  return false;
-#undef DO_
-}
-
-void global_setting::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // @@protoc_insertion_point(serialize_start:setting.global_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required .setting.locate_setting locate_parameter = 1;
-  if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      1, *this->locate_parameter_, output);
-  }
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
-        _internal_metadata_.unknown_fields(), output);
-  }
-  // @@protoc_insertion_point(serialize_end:setting.global_setting)
-}
-
-::google::protobuf::uint8* global_setting::InternalSerializeWithCachedSizesToArray(
-    bool deterministic, ::google::protobuf::uint8* target) const {
-  (void)deterministic; // Unused
-  // @@protoc_insertion_point(serialize_to_array_start:setting.global_setting)
-  ::google::protobuf::uint32 cached_has_bits = 0;
-  (void) cached_has_bits;
-
-  cached_has_bits = _has_bits_[0];
-  // required .setting.locate_setting locate_parameter = 1;
-  if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::
-      InternalWriteMessageToArray(
-        1, *this->locate_parameter_, deterministic, 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:setting.global_setting)
-  return target;
-}
-
-size_t global_setting::ByteSizeLong() const {
-// @@protoc_insertion_point(message_byte_size_start:setting.global_setting)
-  size_t total_size = 0;
-
-  if (_internal_metadata_.have_unknown_fields()) {
-    total_size +=
-      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
-        _internal_metadata_.unknown_fields());
-  }
-  // required .setting.locate_setting locate_parameter = 1;
-  if (has_locate_parameter()) {
-    total_size += 1 +
-      ::google::protobuf::internal::WireFormatLite::MessageSize(
-        *this->locate_parameter_);
-  }
-  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 global_setting::MergeFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_merge_from_start:setting.global_setting)
-  GOOGLE_DCHECK_NE(&from, this);
-  const global_setting* source =
-      ::google::protobuf::internal::DynamicCastToGenerated<const global_setting>(
-          &from);
-  if (source == NULL) {
-  // @@protoc_insertion_point(generalized_merge_from_cast_fail:setting.global_setting)
-    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
-  } else {
-  // @@protoc_insertion_point(generalized_merge_from_cast_success:setting.global_setting)
-    MergeFrom(*source);
-  }
-}
-
-void global_setting::MergeFrom(const global_setting& from) {
-// @@protoc_insertion_point(class_specific_merge_from_start:setting.global_setting)
-  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_locate_parameter()) {
-    mutable_locate_parameter()->::setting::locate_setting::MergeFrom(from.locate_parameter());
-  }
-}
-
-void global_setting::CopyFrom(const ::google::protobuf::Message& from) {
-// @@protoc_insertion_point(generalized_copy_from_start:setting.global_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-void global_setting::CopyFrom(const global_setting& from) {
-// @@protoc_insertion_point(class_specific_copy_from_start:setting.global_setting)
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool global_setting::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
-  if (has_locate_parameter()) {
-    if (!this->locate_parameter_->IsInitialized()) return false;
-  }
-  return true;
-}
-
-void global_setting::Swap(global_setting* other) {
-  if (other == this) return;
-  InternalSwap(other);
-}
-void global_setting::InternalSwap(global_setting* other) {
-  using std::swap;
-  swap(locate_parameter_, other->locate_parameter_);
-  swap(_has_bits_[0], other->_has_bits_[0]);
-  _internal_metadata_.Swap(&other->_internal_metadata_);
-  swap(_cached_size_, other->_cached_size_);
-}
-
-::google::protobuf::Metadata global_setting::GetMetadata() const {
-  protobuf_setting_2eproto::protobuf_AssignDescriptorsOnce();
-  return ::protobuf_setting_2eproto::file_level_metadata[kIndexInFileMessages];
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-}  // namespace setting
-
-// @@protoc_insertion_point(global_scope)

+ 0 - 475
setting.pb.h

@@ -1,475 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: setting.proto
-
-#ifndef PROTOBUF_setting_2eproto__INCLUDED
-#define PROTOBUF_setting_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 3005000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/arena.h>
-#include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/metadata.h>
-#include <google/protobuf/message.h>
-#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
-#include <google/protobuf/extension_set.h>  // IWYU pragma: export
-#include <google/protobuf/unknown_field_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace protobuf_setting_2eproto {
-// Internal implementation detail -- do not use these members.
-struct TableStruct {
-  static const ::google::protobuf::internal::ParseTableField entries[];
-  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
-  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 InitDefaultslocate_settingImpl();
-void InitDefaultslocate_setting();
-void InitDefaultsglobal_settingImpl();
-void InitDefaultsglobal_setting();
-inline void InitDefaults() {
-  InitDefaultslocate_setting();
-  InitDefaultsglobal_setting();
-}
-}  // namespace protobuf_setting_2eproto
-namespace setting {
-class global_setting;
-class global_settingDefaultTypeInternal;
-extern global_settingDefaultTypeInternal _global_setting_default_instance_;
-class locate_setting;
-class locate_settingDefaultTypeInternal;
-extern locate_settingDefaultTypeInternal _locate_setting_default_instance_;
-}  // namespace setting
-namespace setting {
-
-// ===================================================================
-
-class locate_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.locate_setting) */ {
- public:
-  locate_setting();
-  virtual ~locate_setting();
-
-  locate_setting(const locate_setting& from);
-
-  inline locate_setting& operator=(const locate_setting& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  locate_setting(locate_setting&& from) noexcept
-    : locate_setting() {
-    *this = ::std::move(from);
-  }
-
-  inline locate_setting& operator=(locate_setting&& 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 locate_setting& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const locate_setting* internal_default_instance() {
-    return reinterpret_cast<const locate_setting*>(
-               &_locate_setting_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    0;
-
-  void Swap(locate_setting* other);
-  friend void swap(locate_setting& a, locate_setting& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline locate_setting* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  locate_setting* 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 locate_setting& from);
-  void MergeFrom(const locate_setting& 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(locate_setting* 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 string ip = 1;
-  bool has_ip() const;
-  void clear_ip();
-  static const int kIpFieldNumber = 1;
-  const ::std::string& ip() const;
-  void set_ip(const ::std::string& value);
-  #if LANG_CXX11
-  void set_ip(::std::string&& value);
-  #endif
-  void set_ip(const char* value);
-  void set_ip(const char* value, size_t size);
-  ::std::string* mutable_ip();
-  ::std::string* release_ip();
-  void set_allocated_ip(::std::string* ip);
-
-  // required int32 port = 2;
-  bool has_port() const;
-  void clear_port();
-  static const int kPortFieldNumber = 2;
-  ::google::protobuf::int32 port() const;
-  void set_port(::google::protobuf::int32 value);
-
-  // @@protoc_insertion_point(class_scope:setting.locate_setting)
- private:
-  void set_has_ip();
-  void clear_has_ip();
-  void set_has_port();
-  void clear_has_port();
-
-  // helper for ByteSizeLong()
-  size_t RequiredFieldsByteSizeFallback() const;
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr ip_;
-  ::google::protobuf::int32 port_;
-  friend struct ::protobuf_setting_2eproto::TableStruct;
-  friend void ::protobuf_setting_2eproto::InitDefaultslocate_settingImpl();
-};
-// -------------------------------------------------------------------
-
-class global_setting : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:setting.global_setting) */ {
- public:
-  global_setting();
-  virtual ~global_setting();
-
-  global_setting(const global_setting& from);
-
-  inline global_setting& operator=(const global_setting& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  #if LANG_CXX11
-  global_setting(global_setting&& from) noexcept
-    : global_setting() {
-    *this = ::std::move(from);
-  }
-
-  inline global_setting& operator=(global_setting&& 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 global_setting& default_instance();
-
-  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
-  static inline const global_setting* internal_default_instance() {
-    return reinterpret_cast<const global_setting*>(
-               &_global_setting_default_instance_);
-  }
-  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
-    1;
-
-  void Swap(global_setting* other);
-  friend void swap(global_setting& a, global_setting& b) {
-    a.Swap(&b);
-  }
-
-  // implements Message ----------------------------------------------
-
-  inline global_setting* New() const PROTOBUF_FINAL { return New(NULL); }
-
-  global_setting* 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 global_setting& from);
-  void MergeFrom(const global_setting& 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(global_setting* 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 .setting.locate_setting locate_parameter = 1;
-  bool has_locate_parameter() const;
-  void clear_locate_parameter();
-  static const int kLocateParameterFieldNumber = 1;
-  const ::setting::locate_setting& locate_parameter() const;
-  ::setting::locate_setting* release_locate_parameter();
-  ::setting::locate_setting* mutable_locate_parameter();
-  void set_allocated_locate_parameter(::setting::locate_setting* locate_parameter);
-
-  // @@protoc_insertion_point(class_scope:setting.global_setting)
- private:
-  void set_has_locate_parameter();
-  void clear_has_locate_parameter();
-
-  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
-  ::google::protobuf::internal::HasBits<1> _has_bits_;
-  mutable int _cached_size_;
-  ::setting::locate_setting* locate_parameter_;
-  friend struct ::protobuf_setting_2eproto::TableStruct;
-  friend void ::protobuf_setting_2eproto::InitDefaultsglobal_settingImpl();
-};
-// ===================================================================
-
-
-// ===================================================================
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic push
-  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
-#endif  // __GNUC__
-// locate_setting
-
-// required string ip = 1;
-inline bool locate_setting::has_ip() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void locate_setting::set_has_ip() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void locate_setting::clear_has_ip() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void locate_setting::clear_ip() {
-  ip_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_ip();
-}
-inline const ::std::string& locate_setting::ip() const {
-  // @@protoc_insertion_point(field_get:setting.locate_setting.ip)
-  return ip_.GetNoArena();
-}
-inline void locate_setting::set_ip(const ::std::string& value) {
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:setting.locate_setting.ip)
-}
-#if LANG_CXX11
-inline void locate_setting::set_ip(::std::string&& value) {
-  set_has_ip();
-  ip_.SetNoArena(
-    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:setting.locate_setting.ip)
-}
-#endif
-inline void locate_setting::set_ip(const char* value) {
-  GOOGLE_DCHECK(value != NULL);
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:setting.locate_setting.ip)
-}
-inline void locate_setting::set_ip(const char* value, size_t size) {
-  set_has_ip();
-  ip_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
-      ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:setting.locate_setting.ip)
-}
-inline ::std::string* locate_setting::mutable_ip() {
-  set_has_ip();
-  // @@protoc_insertion_point(field_mutable:setting.locate_setting.ip)
-  return ip_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline ::std::string* locate_setting::release_ip() {
-  // @@protoc_insertion_point(field_release:setting.locate_setting.ip)
-  clear_has_ip();
-  return ip_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-}
-inline void locate_setting::set_allocated_ip(::std::string* ip) {
-  if (ip != NULL) {
-    set_has_ip();
-  } else {
-    clear_has_ip();
-  }
-  ip_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ip);
-  // @@protoc_insertion_point(field_set_allocated:setting.locate_setting.ip)
-}
-
-// required int32 port = 2;
-inline bool locate_setting::has_port() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void locate_setting::set_has_port() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void locate_setting::clear_has_port() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void locate_setting::clear_port() {
-  port_ = 0;
-  clear_has_port();
-}
-inline ::google::protobuf::int32 locate_setting::port() const {
-  // @@protoc_insertion_point(field_get:setting.locate_setting.port)
-  return port_;
-}
-inline void locate_setting::set_port(::google::protobuf::int32 value) {
-  set_has_port();
-  port_ = value;
-  // @@protoc_insertion_point(field_set:setting.locate_setting.port)
-}
-
-// -------------------------------------------------------------------
-
-// global_setting
-
-// required .setting.locate_setting locate_parameter = 1;
-inline bool global_setting::has_locate_parameter() const {
-  return (_has_bits_[0] & 0x00000001u) != 0;
-}
-inline void global_setting::set_has_locate_parameter() {
-  _has_bits_[0] |= 0x00000001u;
-}
-inline void global_setting::clear_has_locate_parameter() {
-  _has_bits_[0] &= ~0x00000001u;
-}
-inline void global_setting::clear_locate_parameter() {
-  if (locate_parameter_ != NULL) locate_parameter_->Clear();
-  clear_has_locate_parameter();
-}
-inline const ::setting::locate_setting& global_setting::locate_parameter() const {
-  const ::setting::locate_setting* p = locate_parameter_;
-  // @@protoc_insertion_point(field_get:setting.global_setting.locate_parameter)
-  return p != NULL ? *p : *reinterpret_cast<const ::setting::locate_setting*>(
-      &::setting::_locate_setting_default_instance_);
-}
-inline ::setting::locate_setting* global_setting::release_locate_parameter() {
-  // @@protoc_insertion_point(field_release:setting.global_setting.locate_parameter)
-  clear_has_locate_parameter();
-  ::setting::locate_setting* temp = locate_parameter_;
-  locate_parameter_ = NULL;
-  return temp;
-}
-inline ::setting::locate_setting* global_setting::mutable_locate_parameter() {
-  set_has_locate_parameter();
-  if (locate_parameter_ == NULL) {
-    locate_parameter_ = new ::setting::locate_setting;
-  }
-  // @@protoc_insertion_point(field_mutable:setting.global_setting.locate_parameter)
-  return locate_parameter_;
-}
-inline void global_setting::set_allocated_locate_parameter(::setting::locate_setting* locate_parameter) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete locate_parameter_;
-  }
-  if (locate_parameter) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      locate_parameter = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, locate_parameter, submessage_arena);
-    }
-    set_has_locate_parameter();
-  } else {
-    clear_has_locate_parameter();
-  }
-  locate_parameter_ = locate_parameter;
-  // @@protoc_insertion_point(field_set_allocated:setting.global_setting.locate_parameter)
-}
-
-#ifdef __GNUC__
-  #pragma GCC diagnostic pop
-#endif  // __GNUC__
-// -------------------------------------------------------------------
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace setting
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_setting_2eproto__INCLUDED

+ 0 - 15
setting.proto

@@ -1,15 +0,0 @@
-syntax = "proto2";
-package setting;
-
-message locate_setting
-{
-    required string ip=1;
-    required int32 port=2;
-
-}
-
-message global_setting
-{
-    required locate_setting locate_parameter=1;
-}
-

+ 4 - 3
setting/communication.prototxt

@@ -3,11 +3,12 @@
 communication_parameters
 {
 
-   bind_string:"tcp://192.168.2.166:9000"
-   connect_string_vector:"tcp://192.168.2.166:9001"
+#   bind_string:"tcp://192.168.2.166:9000"
+ #  connect_string_vector:"tcp://192.168.2.166:9001"
  # connect_string_vector:"tcp://192.168.2.166:9002"
 
-   connect_string_vector:"tcp://192.168.2.125:9876"
+  # connect_string_vector:"tcp://192.168.2.125:9876"
+   connect_string_vector:"tcp://192.168.2.166:1234"
 
 }