From 8e304f87e33925f05992b7aa387f76e40694e37c Mon Sep 17 00:00:00 2001 From: wangxx1809 Date: Thu, 11 Apr 2024 10:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E5=92=8C=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=80=9A=E4=BF=A1=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrintC/DataManage/DataHandle.cpp | 44 +- PrintC/DataManage/DataHandle.h | 7 +- PrintC/DataManage/RWData.h | 14 +- PrintC/DataManage/StreamClient.cpp | 14 +- PrintC/config/bean/IOCfg.h | 14 +- PrintC/protobuf/stream.pb.cc | 556 ++++++++++++++--------- PrintC/protobuf/stream.pb.h | 706 +++++++++++++++++------------ PrintC/protobuf/stream.proto | 46 +- PrintS/Config/bean/IOCfg.h | 4 +- PrintS/DataManage/DataHandle.cpp | 20 +- PrintS/DataManage/RWData.h | 18 +- PrintS/DataManage/StreamServer.cpp | 12 +- PrintS/Machine/Machine.h | 2 +- PrintS/PLC/CoreCommunication.cpp | 21 +- PrintS/PLC/SysParam.h | 14 +- PrintS/protobuf/stream.pb.cc | 556 ++++++++++++++--------- PrintS/protobuf/stream.pb.h | 706 +++++++++++++++++------------ PrintS/protobuf/stream.proto | 46 +- 18 files changed, 1669 insertions(+), 1131 deletions(-) diff --git a/PrintC/DataManage/DataHandle.cpp b/PrintC/DataManage/DataHandle.cpp index 5bf26fb..8278235 100644 --- a/PrintC/DataManage/DataHandle.cpp +++ b/PrintC/DataManage/DataHandle.cpp @@ -3,7 +3,8 @@ void DataHandle::DataCallBackProc(void* pthis, const ReadData& msg) { DataHandle* p = (DataHandle*)pthis; - p->DataCallBackHandle(msg); + ReadData readData = msg; + p->DataCallBackHandle(readData); } @@ -25,38 +26,43 @@ void DataHandle::Init() { SetPushMsg(VERSIONREQ); //获取版本信息 } -void DataHandle::DataCallBackHandle(const ReadData& msg) { - std::istringstream issKey(msg.nameKey), issVal(msg.strValue); - string key, value; - switch (msg.dataType) { - case TIMEDATA: - SysParam::Lck(); - while (issKey >> key && issVal >> value) { - size_t pos = value.find("_"); - if (pos == string::npos || SysParam::m_sysParamMp.find(key) == SysParam::m_sysParamMp.end()) continue; - DATATYPE valType = (DATATYPE)atoi(value.substr(pos + 1).c_str()); //值类型 - string val = value.substr(0, pos); //值 + +void DataHandle::UpdateSysParam(const ReadData& msg){ + SysParam::Lck(); + auto it = msg.its.begin(); + while (it != msg.its.end()) { + string key = it->nameKey; + if (SysParam::m_sysParamMp.find(key) != SysParam::m_sysParamMp.end()) { DValue& param = SysParam::m_sysParamMp.at(key); - switch (valType) { + switch ((*it).valueType) { case iBOOL: - param.sysParamB->SetValue((bool)atoi(val.c_str())); + param.sysParamB->SetValue((bool)atoi((*it).strValue.c_str())); break; case iSHORT: - param.sysParamW->SetValue((short)atoi(val.c_str())); + param.sysParamW->SetValue((short)atoi((*it).strValue.c_str())); break; case iINT: - param.sysParamI->SetValue(atoi(val.c_str())); + param.sysParamI->SetValue(atoi((*it).strValue.c_str())); break; case iFLOAT: - param.sysParamF->SetValue(atof(val.c_str())); + param.sysParamF->SetValue(atof((*it).strValue.c_str())); break; default: break; } } - SysParam::UnLck(); + ++it; + } + SysParam::UnLck(); + +} + +void DataHandle::DataCallBackHandle(const ReadData& msg) { + switch (msg.dataType) { + case SYSPARAMDATA: + UpdateSysParam(msg); break; case VERSIONRSP: - m_version = msg.strValue; + m_version = msg.its.front().strValue; break; case IOSIGNALRSP: //io信号返回 ConfigManager::Instance()->GetIoCfgWrapper()->Update(msg); diff --git a/PrintC/DataManage/DataHandle.h b/PrintC/DataManage/DataHandle.h index 9fe1891..70c4707 100644 --- a/PrintC/DataManage/DataHandle.h +++ b/PrintC/DataManage/DataHandle.h @@ -45,11 +45,12 @@ public: private: DataHandle(); virtual ~DataHandle(); - - void DataCallBackHandle(const ReadData& msg); - DataHandle(const DataHandle& d) = delete; DataHandle& operator = (const DataHandle& d) = delete; + + void DataCallBackHandle(const ReadData& msg); + void UpdateSysParam(const ReadData& msg); + private: DataCallBack m_dataCallBack; StreamClient* m_streamClient; diff --git a/PrintC/DataManage/RWData.h b/PrintC/DataManage/RWData.h index 9edc471..8ef764c 100644 --- a/PrintC/DataManage/RWData.h +++ b/PrintC/DataManage/RWData.h @@ -1,6 +1,6 @@ #pragma once -//#include #include +#include enum READTYPE { ProcReadPLC0 = 0, //snap7 数据 @@ -18,6 +18,7 @@ enum READTYPE { INITERRORINFOSRSP, //返回初始化错误信息 VERSIONRSP, //返回版本信息 IOSIGNALRSP, //io信号返回数据 + SYSPARAMDATA, //系统参数数据 }; enum DATATYPE { @@ -29,14 +30,17 @@ enum DATATYPE { iFLOAT }; +struct Item { + std::string nameKey; //参数key + std::string strValue; //value + DATATYPE valueType; //数据类型 +}; + struct ReadData { READTYPE dataType; bool result; - std::string nameKey; //参数key 空格隔开 - std::string strValue; //value 空格隔开 - DATATYPE valueType; //数据类型 - + std::list its; }; diff --git a/PrintC/DataManage/StreamClient.cpp b/PrintC/DataManage/StreamClient.cpp index a508c1d..b3bdffc 100644 --- a/PrintC/DataManage/StreamClient.cpp +++ b/PrintC/DataManage/StreamClient.cpp @@ -64,13 +64,15 @@ void StreamClient::AllStream() { while (!m_readQuitFlag && stream->Read(&readInfo)) { ReadData readData; readData.dataType = (READTYPE)readInfo.datatype(); - readData.nameKey = readInfo.namekey(); - readData.strValue = readInfo.strvalue(); - readData.valueType =(DATATYPE)readInfo.valuetype(); + std::list its; + for (const ::stream::ParamInfo& it : readInfo.item()) { + readData.its.emplace_back(Item{ it.namekey(),it.strvalue(),(DATATYPE)it.valuetype()}); + printf("接收到服务端消息:dataType:%d,nameKey:%s, strvalue:%s,valueType:%d\n", + readData.dataType, it.namekey().data(), it.strvalue().c_str(), it.valuetype()); + } readData.result = readInfo.result(); - printf("服务端消息:dataType:%d,nameKey:%s, strvalue:%s,valueType:%d\n", - readData.dataType, readData.nameKey.c_str(), readInfo.strvalue().c_str(),readData.valueType); + if (m_dataCallBack) { m_dataCallBack(m_handlePtr, readData); @@ -86,7 +88,7 @@ void StreamClient::AllStream() { request.set_namekey(writeData.nameKey); request.set_datatype(writeData.dataType); request.set_strvalue(writeData.strValue); - request.set_valuetype((::stream::RequestInfo_TYPE)writeData.valueType); + request.set_valuetype((::stream::TYPE)writeData.valueType); stream->Write(request); } else { diff --git a/PrintC/config/bean/IOCfg.h b/PrintC/config/bean/IOCfg.h index 826056f..e3164b0 100644 --- a/PrintC/config/bean/IOCfg.h +++ b/PrintC/config/bean/IOCfg.h @@ -1764,16 +1764,14 @@ public: void Update(const ReadData& rd) { Lock(); - std::istringstream issKey(rd.nameKey), issVal(rd.strValue); string keyStr, valStr; - while (issKey >> keyStr && issVal >> valStr) { - size_t pos = valStr.find("_"); - if (m_IOCfgMap.find(keyStr) != m_IOCfgMap.end() && pos != string::npos) { - DATATYPE valType = (DATATYPE)atoi(valStr.substr(pos + 1).c_str()); //值类型 - if (valType != iBOOL) continue; - string val = valStr.substr(0, pos); //值 - m_IOCfgMap[keyStr]->m_IsActive = atoi(val.c_str()); + auto it = rd.its.begin(); + while (it != rd.its.end()) { + keyStr = it->nameKey; + if (m_IOCfgMap.find(keyStr) != m_IOCfgMap.end() && it->valueType == iBOOL) { + m_IOCfgMap[keyStr]->m_IsActive = (bool)atoi(it->strValue.c_str()); } + ++it; } Unlock(); } diff --git a/PrintC/protobuf/stream.pb.cc b/PrintC/protobuf/stream.pb.cc index 49f0256..772076e 100644 --- a/PrintC/protobuf/stream.pb.cc +++ b/PrintC/protobuf/stream.pb.cc @@ -22,6 +22,30 @@ namespace _pbi = ::google::protobuf::internal; namespace _fl = ::google::protobuf::internal::field_layout; namespace stream { template +PROTOBUF_CONSTEXPR ParamInfo::ParamInfo(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.namekey_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.strvalue_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.valuetype_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct ParamInfoDefaultTypeInternal { + PROTOBUF_CONSTEXPR ParamInfoDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ParamInfoDefaultTypeInternal() {} + union { + ParamInfo _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ParamInfoDefaultTypeInternal _ParamInfo_default_instance_; + template PROTOBUF_CONSTEXPR RequestInfo::RequestInfo(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_.namekey_)*/ { @@ -49,17 +73,9 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT template PROTOBUF_CONSTEXPR ResponseInfo::ResponseInfo(::_pbi::ConstantInitialized) : _impl_{ - /*decltype(_impl_.namekey_)*/ { - &::_pbi::fixed_address_empty_string, - ::_pbi::ConstantInitialized{}, - }, - /*decltype(_impl_.strvalue_)*/ { - &::_pbi::fixed_address_empty_string, - ::_pbi::ConstantInitialized{}, - }, + /*decltype(_impl_.item_)*/ {}, /*decltype(_impl_.datatype_)*/ 0u, /*decltype(_impl_.result_)*/ false, - /*decltype(_impl_.valuetype_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}, } {} struct ResponseInfoDefaultTypeInternal { @@ -73,13 +89,24 @@ struct ResponseInfoDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_; } // namespace stream -static ::_pb::Metadata file_level_metadata_stream_2eproto[2]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[2]; +static ::_pb::Metadata file_level_metadata_stream_2eproto[3]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_stream_2eproto = nullptr; const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.namekey_), + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.strvalue_), + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.valuetype_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -101,53 +128,52 @@ const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.datatype_), PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.result_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.namekey_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.strvalue_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.valuetype_), + PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.item_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::stream::RequestInfo)}, - {12, -1, -1, sizeof(::stream::ResponseInfo)}, + {0, -1, -1, sizeof(::stream::ParamInfo)}, + {11, -1, -1, sizeof(::stream::RequestInfo)}, + {23, -1, -1, sizeof(::stream::ResponseInfo)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::stream::_ParamInfo_default_instance_._instance, &::stream::_RequestInfo_default_instance_._instance, &::stream::_ResponseInfo_default_instance_._instance, }; const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\014stream.proto\022\006stream\"\311\001\n\013RequestInfo\022\020" + "\n\014stream.proto\022\006stream\"O\n\tParamInfo\022\017\n\007n" + "ameKey\030\001 \001(\014\022\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueT" + "ype\030\003 \001(\0162\014.stream.TYPE\"c\n\013RequestInfo\022\020" "\n\010dataType\030\001 \001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010str" - "Value\030\003 \001(\014\022+\n\tvalueType\030\004 \001(\0162\030.stream." - "RequestInfo.TYPE\"X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006i" - "SHORT\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020" - "\004\022\n\n\006iFLOAT\020\005\022\013\n\007iSTRING\020\006\"\333\001\n\014ResponseI" - "nfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001(\010\022\017\n" - "\007nameKey\030\003 \001(\014\022\020\n\010strValue\030\004 \001(\014\022,\n\tvalu" - "eType\030\005 \001(\0162\031.stream.ResponseInfo.TYPE\"X" - "\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013\n\007iUSHORT" - "\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLOAT\020\005\022\013\n\007i" - "STRING\020\0062\373\001\n\006Stream\0225\n\006Simple\022\023.stream.R" - "equestInfo\032\024.stream.ResponseInfo\"\000\022=\n\014Se" - "rverStream\022\023.stream.RequestInfo\032\024.stream" - ".ResponseInfo\"\0000\001\022=\n\014ClientStream\022\023.stre" - "am.RequestInfo\032\024.stream.ResponseInfo\"\000(\001" - "\022<\n\tAllStream\022\023.stream.RequestInfo\032\024.str" - "eam.ResponseInfo\"\000(\0010\001B-\n\027io.grpc.exampl" - "es.streamB\013StreamProtoP\001\242\002\002STb\006proto3" + "Value\030\003 \001(\014\022\037\n\tvalueType\030\004 \001(\0162\014.stream." + "TYPE\"Q\n\014ResponseInfo\022\020\n\010dataType\030\001 \001(\r\022\016" + "\n\006result\030\002 \001(\010\022\037\n\004item\030\003 \003(\0132\021.stream.Pa" + "ramInfo*X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013" + "\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLO" + "AT\020\005\022\013\n\007iSTRING\020\0062\373\001\n\006Stream\0225\n\006Simple\022\023" + ".stream.RequestInfo\032\024.stream.ResponseInf" + "o\"\000\022=\n\014ServerStream\022\023.stream.RequestInfo" + "\032\024.stream.ResponseInfo\"\0000\001\022=\n\014ClientStre" + "am\022\023.stream.RequestInfo\032\024.stream.Respons" + "eInfo\"\000(\001\022<\n\tAllStream\022\023.stream.RequestI" + "nfo\032\024.stream.ResponseInfo\"\000(\0010\001B-\n\027io.gr" + "pc.examples.streamB\013StreamProtoP\001\242\002\002STb\006" + "proto3" }; static ::absl::once_flag descriptor_table_stream_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = { false, false, - 757, + 686, descriptor_table_protodef_stream_2eproto, "stream.proto", &descriptor_table_stream_2eproto_once, nullptr, 0, - 2, + 3, schemas, file_default_instances, TableStruct_stream_2eproto::offsets, @@ -174,11 +200,11 @@ PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_stream_2 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_stream_2eproto(&descriptor_table_stream_2eproto); namespace stream { -const ::google::protobuf::EnumDescriptor* RequestInfo_TYPE_descriptor() { +const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto); return file_level_enum_descriptors_stream_2eproto[0]; } -bool RequestInfo_TYPE_IsValid(int value) { +bool TYPE_IsValid(int value) { switch (value) { case 0: case 1: @@ -192,56 +218,258 @@ bool RequestInfo_TYPE_IsValid(int value) { return false; } } -#if (__cplusplus < 201703) && \ - (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +// =================================================================== -constexpr RequestInfo_TYPE RequestInfo::iBOOL; -constexpr RequestInfo_TYPE RequestInfo::iSHORT; -constexpr RequestInfo_TYPE RequestInfo::iUSHORT; -constexpr RequestInfo_TYPE RequestInfo::iINT; -constexpr RequestInfo_TYPE RequestInfo::iUINT; -constexpr RequestInfo_TYPE RequestInfo::iFLOAT; -constexpr RequestInfo_TYPE RequestInfo::iSTRING; -constexpr RequestInfo_TYPE RequestInfo::TYPE_MIN; -constexpr RequestInfo_TYPE RequestInfo::TYPE_MAX; -constexpr int RequestInfo::TYPE_ARRAYSIZE; +class ParamInfo::_Internal { + public: +}; -#endif // (__cplusplus < 201703) && - // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::google::protobuf::EnumDescriptor* ResponseInfo_TYPE_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto); - return file_level_enum_descriptors_stream_2eproto[1]; +ParamInfo::ParamInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:stream.ParamInfo) } -bool ResponseInfo_TYPE_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - return true; - default: - return false; +ParamInfo::ParamInfo(const ParamInfo& from) : ::google::protobuf::Message() { + ParamInfo* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.namekey_){}, + decltype(_impl_.strvalue_){}, + decltype(_impl_.valuetype_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_.namekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.namekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_namekey().empty()) { + _this->_impl_.namekey_.Set(from._internal_namekey(), _this->GetArenaForAllocation()); } + _impl_.strvalue_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_strvalue().empty()) { + _this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation()); + } + _this->_impl_.valuetype_ = from._impl_.valuetype_; + + // @@protoc_insertion_point(copy_constructor:stream.ParamInfo) +} +inline void ParamInfo::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.namekey_){}, + decltype(_impl_.strvalue_){}, + decltype(_impl_.valuetype_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.namekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.namekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +ParamInfo::~ParamInfo() { + // @@protoc_insertion_point(destructor:stream.ParamInfo) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void ParamInfo::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.namekey_.Destroy(); + _impl_.strvalue_.Destroy(); +} +void ParamInfo::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); } -#if (__cplusplus < 201703) && \ - (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -constexpr ResponseInfo_TYPE ResponseInfo::iBOOL; -constexpr ResponseInfo_TYPE ResponseInfo::iSHORT; -constexpr ResponseInfo_TYPE ResponseInfo::iUSHORT; -constexpr ResponseInfo_TYPE ResponseInfo::iINT; -constexpr ResponseInfo_TYPE ResponseInfo::iUINT; -constexpr ResponseInfo_TYPE ResponseInfo::iFLOAT; -constexpr ResponseInfo_TYPE ResponseInfo::iSTRING; -constexpr ResponseInfo_TYPE ResponseInfo::TYPE_MIN; -constexpr ResponseInfo_TYPE ResponseInfo::TYPE_MAX; -constexpr int ResponseInfo::TYPE_ARRAYSIZE; +PROTOBUF_NOINLINE void ParamInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:stream.ParamInfo) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; -#endif // (__cplusplus < 201703) && - // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + _impl_.namekey_.ClearToEmpty(); + _impl_.strvalue_.ClearToEmpty(); + _impl_.valuetype_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* ParamInfo::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 0, 2> ParamInfo::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_ParamInfo_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // bytes nameKey = 1; + {::_pbi::TcParser::FastBS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.namekey_)}}, + // bytes strValue = 2; + {::_pbi::TcParser::FastBS1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.strvalue_)}}, + // .stream.TYPE valueType = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ParamInfo, _impl_.valuetype_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.valuetype_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // bytes nameKey = 1; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.namekey_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, + // bytes strValue = 2; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.strvalue_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, + // .stream.TYPE valueType = 3; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.valuetype_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + }}, +}; + +::uint8_t* ParamInfo::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:stream.ParamInfo) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // bytes nameKey = 1; + if (!this->_internal_namekey().empty()) { + const std::string& _s = this->_internal_namekey(); + target = stream->WriteBytesMaybeAliased(1, _s, target); + } + + // bytes strValue = 2; + if (!this->_internal_strvalue().empty()) { + const std::string& _s = this->_internal_strvalue(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + + // .stream.TYPE valueType = 3; + if (this->_internal_valuetype() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_valuetype(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:stream.ParamInfo) + return target; +} + +::size_t ParamInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:stream.ParamInfo) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bytes nameKey = 1; + if (!this->_internal_namekey().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->_internal_namekey()); + } + + // bytes strValue = 2; + if (!this->_internal_strvalue().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->_internal_strvalue()); + } + + // .stream.TYPE valueType = 3; + if (this->_internal_valuetype() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData ParamInfo::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + ParamInfo::MergeImpl +}; +const ::google::protobuf::Message::ClassData*ParamInfo::GetClassData() const { return &_class_data_; } + + +void ParamInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:stream.ParamInfo) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_namekey().empty()) { + _this->_internal_set_namekey(from._internal_namekey()); + } + if (!from._internal_strvalue().empty()) { + _this->_internal_set_strvalue(from._internal_strvalue()); + } + if (from._internal_valuetype() != 0) { + _this->_internal_set_valuetype(from._internal_valuetype()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void ParamInfo::CopyFrom(const ParamInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:stream.ParamInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool ParamInfo::IsInitialized() const { + return true; +} + +void ParamInfo::InternalSwap(ParamInfo* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.namekey_, lhs_arena, + &other->_impl_.namekey_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena, + &other->_impl_.strvalue_, rhs_arena); + swap(_impl_.valuetype_, other->_impl_.valuetype_); +} + +::google::protobuf::Metadata ParamInfo::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, + file_level_metadata_stream_2eproto[0]); +} // =================================================================== class RequestInfo::_Internal { @@ -353,7 +581,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { &_RequestInfo_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(), {32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}}, // uint32 dataType = 1; @@ -377,7 +605,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { // bytes strValue = 3; {PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.strvalue_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; {PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, }}, @@ -412,7 +640,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { target = stream->WriteBytesMaybeAliased(3, _s, target); } - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; if (this->_internal_valuetype() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -454,7 +682,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { this->_internal_datatype()); } - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; if (this->_internal_valuetype() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); @@ -524,7 +752,7 @@ void RequestInfo::InternalSwap(RequestInfo* other) { ::google::protobuf::Metadata RequestInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, - file_level_metadata_stream_2eproto[0]); + file_level_metadata_stream_2eproto[1]); } // =================================================================== @@ -541,53 +769,27 @@ ResponseInfo::ResponseInfo(const ResponseInfo& from) : ::google::protobuf::Messa ResponseInfo* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.namekey_){}, - decltype(_impl_.strvalue_){}, + decltype(_impl_.item_){from._impl_.item_}, decltype(_impl_.datatype_){}, decltype(_impl_.result_){}, - decltype(_impl_.valuetype_){}, /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _impl_.namekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.namekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_namekey().empty()) { - _this->_impl_.namekey_.Set(from._internal_namekey(), _this->GetArenaForAllocation()); - } - _impl_.strvalue_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_strvalue().empty()) { - _this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation()); - } ::memcpy(&_impl_.datatype_, &from._impl_.datatype_, - static_cast<::size_t>(reinterpret_cast(&_impl_.valuetype_) - - reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.valuetype_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.result_) - + reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.result_)); // @@protoc_insertion_point(copy_constructor:stream.ResponseInfo) } inline void ResponseInfo::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.namekey_){}, - decltype(_impl_.strvalue_){}, + decltype(_impl_.item_){arena}, decltype(_impl_.datatype_){0u}, decltype(_impl_.result_){false}, - decltype(_impl_.valuetype_){0}, /*decltype(_impl_._cached_size_)*/ {}, }; - _impl_.namekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.namekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } ResponseInfo::~ResponseInfo() { // @@protoc_insertion_point(destructor:stream.ResponseInfo) @@ -596,8 +798,7 @@ ResponseInfo::~ResponseInfo() { } inline void ResponseInfo::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.namekey_.Destroy(); - _impl_.strvalue_.Destroy(); + _impl_.item_.~RepeatedPtrField(); } void ResponseInfo::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -609,11 +810,10 @@ PROTOBUF_NOINLINE void ResponseInfo::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.namekey_.ClearToEmpty(); - _impl_.strvalue_.ClearToEmpty(); + _internal_mutable_item()->Clear(); ::memset(&_impl_.datatype_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.valuetype_) - - reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.valuetype_)); + reinterpret_cast(&_impl_.result_) - + reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.result_)); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -625,17 +825,17 @@ const char* ResponseInfo::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { +const ::_pbi::TcParseTable<2, 3, 1, 0, 2> ResponseInfo::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 3, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_ResponseInfo_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -646,17 +846,9 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // bool result = 2; {::_pbi::TcParser::SingularVarintNoZag1(), {16, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_)}}, - // bytes nameKey = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.namekey_)}}, - // bytes strValue = 4; - {::_pbi::TcParser::FastBS1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.strvalue_)}}, - // .stream.ResponseInfo.TYPE valueType = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ResponseInfo, _impl_.valuetype_), 63>(), - {40, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + // repeated .stream.ParamInfo item = 3; + {::_pbi::TcParser::FastMtR1, + {26, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.item_)}}, }}, {{ 65535, 65535 }}, {{ @@ -666,18 +858,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // bool result = 2; {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bytes nameKey = 3; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.namekey_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes strValue = 4; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.strvalue_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // .stream.ResponseInfo.TYPE valueType = 5; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - }}, - // no aux_entries - {{ + // repeated .stream.ParamInfo item = 3; + {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.item_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::stream::ParamInfo>()}, + }}, {{ }}, }; @@ -702,23 +888,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { 2, this->_internal_result(), target); } - // bytes nameKey = 3; - if (!this->_internal_namekey().empty()) { - const std::string& _s = this->_internal_namekey(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // bytes strValue = 4; - if (!this->_internal_strvalue().empty()) { - const std::string& _s = this->_internal_strvalue(); - target = stream->WriteBytesMaybeAliased(4, _s, target); - } - - // .stream.ResponseInfo.TYPE valueType = 5; - if (this->_internal_valuetype() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 5, this->_internal_valuetype(), target); + // repeated .stream.ParamInfo item = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_item_size()); i < n; i++) { + const auto& repfield = this->_internal_item().Get(i); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -738,18 +913,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // bytes nameKey = 3; - if (!this->_internal_namekey().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_namekey()); + // repeated .stream.ParamInfo item = 3; + total_size += 1UL * this->_internal_item_size(); + for (const auto& msg : this->_internal_item()) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - - // bytes strValue = 4; - if (!this->_internal_strvalue().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_strvalue()); - } - // uint32 dataType = 1; if (this->_internal_datatype() != 0) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( @@ -761,12 +930,6 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { total_size += 2; } - // .stream.ResponseInfo.TYPE valueType = 5; - if (this->_internal_valuetype() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -785,21 +948,13 @@ void ResponseInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_namekey().empty()) { - _this->_internal_set_namekey(from._internal_namekey()); - } - if (!from._internal_strvalue().empty()) { - _this->_internal_set_strvalue(from._internal_strvalue()); - } + _this->_internal_mutable_item()->MergeFrom(from._internal_item()); if (from._internal_datatype() != 0) { _this->_internal_set_datatype(from._internal_datatype()); } if (from._internal_result() != 0) { _this->_internal_set_result(from._internal_result()); } - if (from._internal_valuetype() != 0) { - _this->_internal_set_valuetype(from._internal_valuetype()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -816,16 +971,11 @@ PROTOBUF_NOINLINE bool ResponseInfo::IsInitialized() const { void ResponseInfo::InternalSwap(ResponseInfo* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.namekey_, lhs_arena, - &other->_impl_.namekey_, rhs_arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena, - &other->_impl_.strvalue_, rhs_arena); + _impl_.item_.InternalSwap(&other->_impl_.item_); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_) - + sizeof(ResponseInfo::_impl_.valuetype_) + PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_) + + sizeof(ResponseInfo::_impl_.result_) - PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.datatype_)>( reinterpret_cast(&_impl_.datatype_), reinterpret_cast(&other->_impl_.datatype_)); @@ -834,7 +984,7 @@ void ResponseInfo::InternalSwap(ResponseInfo* other) { ::google::protobuf::Metadata ResponseInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, - file_level_metadata_stream_2eproto[1]); + file_level_metadata_stream_2eproto[2]); } // @@protoc_insertion_point(namespace_scope) } // namespace stream diff --git a/PrintC/protobuf/stream.pb.h b/PrintC/protobuf/stream.pb.h index 7da7bbe..635d478 100644 --- a/PrintC/protobuf/stream.pb.h +++ b/PrintC/protobuf/stream.pb.h @@ -55,6 +55,9 @@ struct TableStruct_stream_2eproto { extern const ::google::protobuf::internal::DescriptorTable descriptor_table_stream_2eproto; namespace stream { +class ParamInfo; +struct ParamInfoDefaultTypeInternal; +extern ParamInfoDefaultTypeInternal _ParamInfo_default_instance_; class RequestInfo; struct RequestInfoDefaultTypeInternal; extern RequestInfoDefaultTypeInternal _RequestInfo_default_instance_; @@ -68,79 +71,42 @@ namespace protobuf { } // namespace google namespace stream { -enum RequestInfo_TYPE : int { - RequestInfo_TYPE_iBOOL = 0, - RequestInfo_TYPE_iSHORT = 1, - RequestInfo_TYPE_iUSHORT = 2, - RequestInfo_TYPE_iINT = 3, - RequestInfo_TYPE_iUINT = 4, - RequestInfo_TYPE_iFLOAT = 5, - RequestInfo_TYPE_iSTRING = 6, - RequestInfo_TYPE_RequestInfo_TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = +enum TYPE : int { + iBOOL = 0, + iSHORT = 1, + iUSHORT = 2, + iINT = 3, + iUINT = 4, + iFLOAT = 5, + iSTRING = 6, + TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::min(), - RequestInfo_TYPE_RequestInfo_TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = + TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::max(), }; -bool RequestInfo_TYPE_IsValid(int value); -constexpr RequestInfo_TYPE RequestInfo_TYPE_TYPE_MIN = static_cast(0); -constexpr RequestInfo_TYPE RequestInfo_TYPE_TYPE_MAX = static_cast(6); -constexpr int RequestInfo_TYPE_TYPE_ARRAYSIZE = 6 + 1; +bool TYPE_IsValid(int value); +constexpr TYPE TYPE_MIN = static_cast(0); +constexpr TYPE TYPE_MAX = static_cast(6); +constexpr int TYPE_ARRAYSIZE = 6 + 1; const ::google::protobuf::EnumDescriptor* -RequestInfo_TYPE_descriptor(); +TYPE_descriptor(); template -const std::string& RequestInfo_TYPE_Name(T value) { - static_assert(std::is_same::value || +const std::string& TYPE_Name(T value) { + static_assert(std::is_same::value || std::is_integral::value, "Incorrect type passed to TYPE_Name()."); - return RequestInfo_TYPE_Name(static_cast(value)); + return TYPE_Name(static_cast(value)); } template <> -inline const std::string& RequestInfo_TYPE_Name(RequestInfo_TYPE value) { - return ::google::protobuf::internal::NameOfDenseEnum( static_cast(value)); } -inline bool RequestInfo_TYPE_Parse(absl::string_view name, RequestInfo_TYPE* value) { - return ::google::protobuf::internal::ParseNamedEnum( - RequestInfo_TYPE_descriptor(), name, value); -} -enum ResponseInfo_TYPE : int { - ResponseInfo_TYPE_iBOOL = 0, - ResponseInfo_TYPE_iSHORT = 1, - ResponseInfo_TYPE_iUSHORT = 2, - ResponseInfo_TYPE_iINT = 3, - ResponseInfo_TYPE_iUINT = 4, - ResponseInfo_TYPE_iFLOAT = 5, - ResponseInfo_TYPE_iSTRING = 6, - ResponseInfo_TYPE_ResponseInfo_TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - ResponseInfo_TYPE_ResponseInfo_TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool ResponseInfo_TYPE_IsValid(int value); -constexpr ResponseInfo_TYPE ResponseInfo_TYPE_TYPE_MIN = static_cast(0); -constexpr ResponseInfo_TYPE ResponseInfo_TYPE_TYPE_MAX = static_cast(6); -constexpr int ResponseInfo_TYPE_TYPE_ARRAYSIZE = 6 + 1; -const ::google::protobuf::EnumDescriptor* -ResponseInfo_TYPE_descriptor(); -template -const std::string& ResponseInfo_TYPE_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to TYPE_Name()."); - return ResponseInfo_TYPE_Name(static_cast(value)); -} -template <> -inline const std::string& ResponseInfo_TYPE_Name(ResponseInfo_TYPE value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool ResponseInfo_TYPE_Parse(absl::string_view name, ResponseInfo_TYPE* value) { - return ::google::protobuf::internal::ParseNamedEnum( - ResponseInfo_TYPE_descriptor(), name, value); +inline bool TYPE_Parse(absl::string_view name, TYPE* value) { + return ::google::protobuf::internal::ParseNamedEnum( + TYPE_descriptor(), name, value); } // =================================================================== @@ -148,6 +114,200 @@ inline bool ResponseInfo_TYPE_Parse(absl::string_view name, ResponseInfo_TYPE* v // ------------------------------------------------------------------- +class ParamInfo final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.ParamInfo) */ { + public: + inline ParamInfo() : ParamInfo(nullptr) {} + ~ParamInfo() override; + template + explicit PROTOBUF_CONSTEXPR ParamInfo(::google::protobuf::internal::ConstantInitialized); + + ParamInfo(const ParamInfo& from); + ParamInfo(ParamInfo&& from) noexcept + : ParamInfo() { + *this = ::std::move(from); + } + + inline ParamInfo& operator=(const ParamInfo& from) { + CopyFrom(from); + return *this; + } + inline ParamInfo& operator=(ParamInfo&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ParamInfo& default_instance() { + return *internal_default_instance(); + } + static inline const ParamInfo* internal_default_instance() { + return reinterpret_cast( + &_ParamInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(ParamInfo& a, ParamInfo& b) { + a.Swap(&b); + } + inline void Swap(ParamInfo* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ParamInfo* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ParamInfo* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ParamInfo& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const ParamInfo& from) { + ParamInfo::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ParamInfo* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "stream.ParamInfo"; + } + protected: + explicit ParamInfo(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameKeyFieldNumber = 1, + kStrValueFieldNumber = 2, + kValueTypeFieldNumber = 3, + }; + // bytes nameKey = 1; + void clear_namekey() ; + const std::string& namekey() const; + template + void set_namekey(Arg_&& arg, Args_... args); + std::string* mutable_namekey(); + PROTOBUF_NODISCARD std::string* release_namekey(); + void set_allocated_namekey(std::string* ptr); + + private: + const std::string& _internal_namekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_namekey( + const std::string& value); + std::string* _internal_mutable_namekey(); + + public: + // bytes strValue = 2; + void clear_strvalue() ; + const std::string& strvalue() const; + template + void set_strvalue(Arg_&& arg, Args_... args); + std::string* mutable_strvalue(); + PROTOBUF_NODISCARD std::string* release_strvalue(); + void set_allocated_strvalue(std::string* ptr); + + private: + const std::string& _internal_strvalue() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_strvalue( + const std::string& value); + std::string* _internal_mutable_strvalue(); + + public: + // .stream.TYPE valueType = 3; + void clear_valuetype() ; + ::stream::TYPE valuetype() const; + void set_valuetype(::stream::TYPE value); + + private: + ::stream::TYPE _internal_valuetype() const; + void _internal_set_valuetype(::stream::TYPE value); + + public: + // @@protoc_insertion_point(class_scope:stream.ParamInfo) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr namekey_; + ::google::protobuf::internal::ArenaStringPtr strvalue_; + int valuetype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_stream_2eproto; +};// ------------------------------------------------------------------- + class RequestInfo final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.RequestInfo) */ { public: @@ -204,7 +364,7 @@ class RequestInfo final : &_RequestInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(RequestInfo& a, RequestInfo& b) { a.Swap(&b); @@ -273,31 +433,6 @@ class RequestInfo final : // nested types ---------------------------------------------------- - using TYPE = RequestInfo_TYPE; - static constexpr TYPE iBOOL = RequestInfo_TYPE_iBOOL; - static constexpr TYPE iSHORT = RequestInfo_TYPE_iSHORT; - static constexpr TYPE iUSHORT = RequestInfo_TYPE_iUSHORT; - static constexpr TYPE iINT = RequestInfo_TYPE_iINT; - static constexpr TYPE iUINT = RequestInfo_TYPE_iUINT; - static constexpr TYPE iFLOAT = RequestInfo_TYPE_iFLOAT; - static constexpr TYPE iSTRING = RequestInfo_TYPE_iSTRING; - static inline bool TYPE_IsValid(int value) { - return RequestInfo_TYPE_IsValid(value); - } - static constexpr TYPE TYPE_MIN = RequestInfo_TYPE_TYPE_MIN; - static constexpr TYPE TYPE_MAX = RequestInfo_TYPE_TYPE_MAX; - static constexpr int TYPE_ARRAYSIZE = RequestInfo_TYPE_TYPE_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { - return RequestInfo_TYPE_descriptor(); - } - template - static inline const std::string& TYPE_Name(T value) { - return RequestInfo_TYPE_Name(value); - } - static inline bool TYPE_Parse(absl::string_view name, TYPE* value) { - return RequestInfo_TYPE_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { @@ -348,14 +483,14 @@ class RequestInfo final : void _internal_set_datatype(::uint32_t value); public: - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; void clear_valuetype() ; - ::stream::RequestInfo_TYPE valuetype() const; - void set_valuetype(::stream::RequestInfo_TYPE value); + ::stream::TYPE valuetype() const; + void set_valuetype(::stream::TYPE value); private: - ::stream::RequestInfo_TYPE _internal_valuetype() const; - void _internal_set_valuetype(::stream::RequestInfo_TYPE value); + ::stream::TYPE _internal_valuetype() const; + void _internal_set_valuetype(::stream::TYPE value); public: // @@protoc_insertion_point(class_scope:stream.RequestInfo) @@ -435,7 +570,7 @@ class ResponseInfo final : &_ResponseInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(ResponseInfo& a, ResponseInfo& b) { a.Swap(&b); @@ -504,72 +639,31 @@ class ResponseInfo final : // nested types ---------------------------------------------------- - using TYPE = ResponseInfo_TYPE; - static constexpr TYPE iBOOL = ResponseInfo_TYPE_iBOOL; - static constexpr TYPE iSHORT = ResponseInfo_TYPE_iSHORT; - static constexpr TYPE iUSHORT = ResponseInfo_TYPE_iUSHORT; - static constexpr TYPE iINT = ResponseInfo_TYPE_iINT; - static constexpr TYPE iUINT = ResponseInfo_TYPE_iUINT; - static constexpr TYPE iFLOAT = ResponseInfo_TYPE_iFLOAT; - static constexpr TYPE iSTRING = ResponseInfo_TYPE_iSTRING; - static inline bool TYPE_IsValid(int value) { - return ResponseInfo_TYPE_IsValid(value); - } - static constexpr TYPE TYPE_MIN = ResponseInfo_TYPE_TYPE_MIN; - static constexpr TYPE TYPE_MAX = ResponseInfo_TYPE_TYPE_MAX; - static constexpr int TYPE_ARRAYSIZE = ResponseInfo_TYPE_TYPE_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { - return ResponseInfo_TYPE_descriptor(); - } - template - static inline const std::string& TYPE_Name(T value) { - return ResponseInfo_TYPE_Name(value); - } - static inline bool TYPE_Parse(absl::string_view name, TYPE* value) { - return ResponseInfo_TYPE_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kNameKeyFieldNumber = 3, - kStrValueFieldNumber = 4, + kItemFieldNumber = 3, kDataTypeFieldNumber = 1, kResultFieldNumber = 2, - kValueTypeFieldNumber = 5, }; - // bytes nameKey = 3; - void clear_namekey() ; - const std::string& namekey() const; - template - void set_namekey(Arg_&& arg, Args_... args); - std::string* mutable_namekey(); - PROTOBUF_NODISCARD std::string* release_namekey(); - void set_allocated_namekey(std::string* ptr); - + // repeated .stream.ParamInfo item = 3; + int item_size() const; private: - const std::string& _internal_namekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_namekey( - const std::string& value); - std::string* _internal_mutable_namekey(); + int _internal_item_size() const; public: - // bytes strValue = 4; - void clear_strvalue() ; - const std::string& strvalue() const; - template - void set_strvalue(Arg_&& arg, Args_... args); - std::string* mutable_strvalue(); - PROTOBUF_NODISCARD std::string* release_strvalue(); - void set_allocated_strvalue(std::string* ptr); - + void clear_item() ; + ::stream::ParamInfo* mutable_item(int index); + ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >* + mutable_item(); private: - const std::string& _internal_strvalue() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_strvalue( - const std::string& value); - std::string* _internal_mutable_strvalue(); - + const ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>& _internal_item() const; + ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>* _internal_mutable_item(); public: + const ::stream::ParamInfo& item(int index) const; + ::stream::ParamInfo* add_item(); + const ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >& + item() const; // uint32 dataType = 1; void clear_datatype() ; ::uint32_t datatype() const; @@ -589,32 +683,20 @@ class ResponseInfo final : bool _internal_result() const; void _internal_set_result(bool value); - public: - // .stream.ResponseInfo.TYPE valueType = 5; - void clear_valuetype() ; - ::stream::ResponseInfo_TYPE valuetype() const; - void set_valuetype(::stream::ResponseInfo_TYPE value); - - private: - ::stream::ResponseInfo_TYPE _internal_valuetype() const; - void _internal_set_valuetype(::stream::ResponseInfo_TYPE value); - public: // @@protoc_insertion_point(class_scope:stream.ResponseInfo) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 3, 1, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr namekey_; - ::google::protobuf::internal::ArenaStringPtr strvalue_; + ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo > item_; ::uint32_t datatype_; bool result_; - int valuetype_; mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -636,6 +718,134 @@ class ResponseInfo final : #endif // __GNUC__ // ------------------------------------------------------------------- +// ParamInfo + +// bytes nameKey = 1; +inline void ParamInfo::clear_namekey() { + _impl_.namekey_.ClearToEmpty(); +} +inline const std::string& ParamInfo::namekey() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.nameKey) + return _internal_namekey(); +} +template +inline PROTOBUF_ALWAYS_INLINE void ParamInfo::set_namekey(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.namekey_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:stream.ParamInfo.nameKey) +} +inline std::string* ParamInfo::mutable_namekey() { + std::string* _s = _internal_mutable_namekey(); + // @@protoc_insertion_point(field_mutable:stream.ParamInfo.nameKey) + return _s; +} +inline const std::string& ParamInfo::_internal_namekey() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.namekey_.Get(); +} +inline void ParamInfo::_internal_set_namekey(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.namekey_.Set(value, GetArenaForAllocation()); +} +inline std::string* ParamInfo::_internal_mutable_namekey() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.namekey_.Mutable( GetArenaForAllocation()); +} +inline std::string* ParamInfo::release_namekey() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:stream.ParamInfo.nameKey) + return _impl_.namekey_.Release(); +} +inline void ParamInfo::set_allocated_namekey(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.namekey_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.namekey_.IsDefault()) { + _impl_.namekey_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:stream.ParamInfo.nameKey) +} + +// bytes strValue = 2; +inline void ParamInfo::clear_strvalue() { + _impl_.strvalue_.ClearToEmpty(); +} +inline const std::string& ParamInfo::strvalue() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.strValue) + return _internal_strvalue(); +} +template +inline PROTOBUF_ALWAYS_INLINE void ParamInfo::set_strvalue(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.strvalue_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:stream.ParamInfo.strValue) +} +inline std::string* ParamInfo::mutable_strvalue() { + std::string* _s = _internal_mutable_strvalue(); + // @@protoc_insertion_point(field_mutable:stream.ParamInfo.strValue) + return _s; +} +inline const std::string& ParamInfo::_internal_strvalue() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.strvalue_.Get(); +} +inline void ParamInfo::_internal_set_strvalue(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.strvalue_.Set(value, GetArenaForAllocation()); +} +inline std::string* ParamInfo::_internal_mutable_strvalue() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.strvalue_.Mutable( GetArenaForAllocation()); +} +inline std::string* ParamInfo::release_strvalue() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:stream.ParamInfo.strValue) + return _impl_.strvalue_.Release(); +} +inline void ParamInfo::set_allocated_strvalue(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.strvalue_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.strvalue_.IsDefault()) { + _impl_.strvalue_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:stream.ParamInfo.strValue) +} + +// .stream.TYPE valueType = 3; +inline void ParamInfo::clear_valuetype() { + _impl_.valuetype_ = 0; +} +inline ::stream::TYPE ParamInfo::valuetype() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.valueType) + return _internal_valuetype(); +} +inline void ParamInfo::set_valuetype(::stream::TYPE value) { + _internal_set_valuetype(value); + // @@protoc_insertion_point(field_set:stream.ParamInfo.valueType) +} +inline ::stream::TYPE ParamInfo::_internal_valuetype() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::stream::TYPE>(_impl_.valuetype_); +} +inline void ParamInfo::_internal_set_valuetype(::stream::TYPE value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.valuetype_ = value; +} + +// ------------------------------------------------------------------- + // RequestInfo // uint32 dataType = 1; @@ -762,23 +972,23 @@ inline void RequestInfo::set_allocated_strvalue(std::string* value) { // @@protoc_insertion_point(field_set_allocated:stream.RequestInfo.strValue) } -// .stream.RequestInfo.TYPE valueType = 4; +// .stream.TYPE valueType = 4; inline void RequestInfo::clear_valuetype() { _impl_.valuetype_ = 0; } -inline ::stream::RequestInfo_TYPE RequestInfo::valuetype() const { +inline ::stream::TYPE RequestInfo::valuetype() const { // @@protoc_insertion_point(field_get:stream.RequestInfo.valueType) return _internal_valuetype(); } -inline void RequestInfo::set_valuetype(::stream::RequestInfo_TYPE value) { +inline void RequestInfo::set_valuetype(::stream::TYPE value) { _internal_set_valuetype(value); // @@protoc_insertion_point(field_set:stream.RequestInfo.valueType) } -inline ::stream::RequestInfo_TYPE RequestInfo::_internal_valuetype() const { +inline ::stream::TYPE RequestInfo::_internal_valuetype() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::stream::RequestInfo_TYPE>(_impl_.valuetype_); + return static_cast<::stream::TYPE>(_impl_.valuetype_); } -inline void RequestInfo::_internal_set_valuetype(::stream::RequestInfo_TYPE value) { +inline void RequestInfo::_internal_set_valuetype(::stream::TYPE value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.valuetype_ = value; @@ -832,128 +1042,50 @@ inline void ResponseInfo::_internal_set_result(bool value) { _impl_.result_ = value; } -// bytes nameKey = 3; -inline void ResponseInfo::clear_namekey() { - _impl_.namekey_.ClearToEmpty(); +// repeated .stream.ParamInfo item = 3; +inline int ResponseInfo::_internal_item_size() const { + return _internal_item().size(); } -inline const std::string& ResponseInfo::namekey() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.nameKey) - return _internal_namekey(); +inline int ResponseInfo::item_size() const { + return _internal_item_size(); } -template -inline PROTOBUF_ALWAYS_INLINE void ResponseInfo::set_namekey(Arg_&& arg, - Args_... args) { +inline void ResponseInfo::clear_item() { + _internal_mutable_item()->Clear(); +} +inline ::stream::ParamInfo* ResponseInfo::mutable_item(int index) { + // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.item) + return _internal_mutable_item()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >* +ResponseInfo::mutable_item() { + // @@protoc_insertion_point(field_mutable_list:stream.ResponseInfo.item) PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.namekey_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.nameKey) + return _internal_mutable_item(); } -inline std::string* ResponseInfo::mutable_namekey() { - std::string* _s = _internal_mutable_namekey(); - // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.nameKey) - return _s; +inline const ::stream::ParamInfo& ResponseInfo::item(int index) const { + // @@protoc_insertion_point(field_get:stream.ResponseInfo.item) + return _internal_item().Get(index); } -inline const std::string& ResponseInfo::_internal_namekey() const { +inline ::stream::ParamInfo* ResponseInfo::add_item() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::stream::ParamInfo* _add = _internal_mutable_item()->Add(); + // @@protoc_insertion_point(field_add:stream.ResponseInfo.item) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >& +ResponseInfo::item() const { + // @@protoc_insertion_point(field_list:stream.ResponseInfo.item) + return _internal_item(); +} +inline const ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>& +ResponseInfo::_internal_item() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.namekey_.Get(); + return _impl_.item_; } -inline void ResponseInfo::_internal_set_namekey(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.namekey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ResponseInfo::_internal_mutable_namekey() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.namekey_.Mutable( GetArenaForAllocation()); -} -inline std::string* ResponseInfo::release_namekey() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:stream.ResponseInfo.nameKey) - return _impl_.namekey_.Release(); -} -inline void ResponseInfo::set_allocated_namekey(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.namekey_.SetAllocated(value, GetArenaForAllocation()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.namekey_.IsDefault()) { - _impl_.namekey_.Set("", GetArenaForAllocation()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:stream.ResponseInfo.nameKey) -} - -// bytes strValue = 4; -inline void ResponseInfo::clear_strvalue() { - _impl_.strvalue_.ClearToEmpty(); -} -inline const std::string& ResponseInfo::strvalue() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.strValue) - return _internal_strvalue(); -} -template -inline PROTOBUF_ALWAYS_INLINE void ResponseInfo::set_strvalue(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.strvalue_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.strValue) -} -inline std::string* ResponseInfo::mutable_strvalue() { - std::string* _s = _internal_mutable_strvalue(); - // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.strValue) - return _s; -} -inline const std::string& ResponseInfo::_internal_strvalue() const { +inline ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>* +ResponseInfo::_internal_mutable_item() { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.strvalue_.Get(); -} -inline void ResponseInfo::_internal_set_strvalue(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.strvalue_.Set(value, GetArenaForAllocation()); -} -inline std::string* ResponseInfo::_internal_mutable_strvalue() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.strvalue_.Mutable( GetArenaForAllocation()); -} -inline std::string* ResponseInfo::release_strvalue() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:stream.ResponseInfo.strValue) - return _impl_.strvalue_.Release(); -} -inline void ResponseInfo::set_allocated_strvalue(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.strvalue_.SetAllocated(value, GetArenaForAllocation()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.strvalue_.IsDefault()) { - _impl_.strvalue_.Set("", GetArenaForAllocation()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:stream.ResponseInfo.strValue) -} - -// .stream.ResponseInfo.TYPE valueType = 5; -inline void ResponseInfo::clear_valuetype() { - _impl_.valuetype_ = 0; -} -inline ::stream::ResponseInfo_TYPE ResponseInfo::valuetype() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.valueType) - return _internal_valuetype(); -} -inline void ResponseInfo::set_valuetype(::stream::ResponseInfo_TYPE value) { - _internal_set_valuetype(value); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.valueType) -} -inline ::stream::ResponseInfo_TYPE ResponseInfo::_internal_valuetype() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::stream::ResponseInfo_TYPE>(_impl_.valuetype_); -} -inline void ResponseInfo::_internal_set_valuetype(::stream::ResponseInfo_TYPE value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.valuetype_ = value; + return &_impl_.item_; } #ifdef __GNUC__ @@ -968,16 +1100,10 @@ namespace google { namespace protobuf { template <> -struct is_proto_enum<::stream::RequestInfo_TYPE> : std::true_type {}; +struct is_proto_enum<::stream::TYPE> : std::true_type {}; template <> -inline const EnumDescriptor* GetEnumDescriptor<::stream::RequestInfo_TYPE>() { - return ::stream::RequestInfo_TYPE_descriptor(); -} -template <> -struct is_proto_enum<::stream::ResponseInfo_TYPE> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::stream::ResponseInfo_TYPE>() { - return ::stream::ResponseInfo_TYPE_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor<::stream::TYPE>() { + return ::stream::TYPE_descriptor(); } } // namespace protobuf diff --git a/PrintC/protobuf/stream.proto b/PrintC/protobuf/stream.proto index 9627f36..0efa1bc 100644 --- a/PrintC/protobuf/stream.proto +++ b/PrintC/protobuf/stream.proto @@ -9,40 +9,34 @@ option java_package = "io.grpc.examples.stream"; option java_outer_classname = "StreamProto"; option objc_class_prefix = "ST"; +enum TYPE{ + iBOOL = 0; + iSHORT = 1; + iUSHORT = 2; + iINT = 3; + iUINT = 4; + iFLOAT = 5; + iSTRING = 6; +} + +message ParamInfo{ + bytes nameKey = 1; //参数key + bytes strValue = 2; //value + TYPE valueType = 3; //数据类型 +} + message RequestInfo { uint32 dataType = 1; //信息类型 bytes nameKey = 2; //参数key - bytes strValue = 3; //value - - enum TYPE{ - iBOOL = 0; - iSHORT = 1; - iUSHORT = 2; - iINT = 3; - iUINT = 4; - iFLOAT = 5; - iSTRING = 6; - } - TYPE valueType = 4; + bytes strValue = 3; //value值 + TYPE valueType = 4; //value数据类型 } message ResponseInfo { uint32 dataType = 1; //信息类型 - bool result = 2; - bytes nameKey = 3; //参数key - bytes strValue = 4; //value - - enum TYPE{ - iBOOL = 0; - iSHORT = 1; - iUSHORT = 2; - iINT = 3; - iUINT = 4; - iFLOAT = 5; - iSTRING = 6; - } - TYPE valueType = 5; //数据类型 + bool result = 2; //执行成功与否 + repeated ParamInfo item = 3; //参数值 } diff --git a/PrintS/Config/bean/IOCfg.h b/PrintS/Config/bean/IOCfg.h index 6a12472..ea1dbb9 100644 --- a/PrintS/Config/bean/IOCfg.h +++ b/PrintS/Config/bean/IOCfg.h @@ -48,12 +48,12 @@ public: int m_MachineType; int m_StatusAddr; int m_CtrlAddr; - bool m_IsOutput; + bool m_IsOutput; //true 可修改 false:只读 string m_Code; string m_Content; bool m_IsActive; - int m_AuthLess; + int m_AuthLess; //用户等级 string m_ShowContent; private: PLCReveiver* m_cc; diff --git a/PrintS/DataManage/DataHandle.cpp b/PrintS/DataManage/DataHandle.cpp index ed17cc6..30befc9 100644 --- a/PrintS/DataManage/DataHandle.cpp +++ b/PrintS/DataManage/DataHandle.cpp @@ -44,14 +44,8 @@ void DataHandle::Init() { m_testTd = std::thread ([this] { static float i = 10.12540f; while (!m_testFlag) { - WriteData* wd = new WriteData(); - wd->dataType = RESPOND; - wd->strValue = std::to_string(i); - wd->nameKey = "hello"; - wd->result = true; - wd->valueType = iFLOAT; if (m_streamServer && m_streamServer->GetClient()) - m_streamServer->GetClient()->PushMsg(wd); + m_streamServer->GetClient()->PushMsg(new WriteData(RESPOND, { {string("hello"),std::to_string(i),iFLOAT}})); std::this_thread::sleep_for(std::chrono::seconds(1)); } }); @@ -204,18 +198,10 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) { if ((*scanners)[index]) (*scanners)[index]->StopHeatingScannerTest(); break; case INITERRORINFOSREQ: //初始化错误信息 - wd = new WriteData(); - wd->strValue = m_controller->m_ScannerCtrl->GetInitErrorInfos(); - wd->dataType = INITERRORINFOSRSP; - wd->valueType = iSTRING; - msg.clientPtr->PushMsg(wd); + msg.clientPtr->PushMsg(new WriteData(INITERRORINFOSRSP, { {string(""), m_controller->m_ScannerCtrl->GetInitErrorInfos(), iSTRING} })); break; case VERSIONREQ: //获取版本信息 - wd = new WriteData(); - wd->strValue = g_SystemInfo->m_ProductVersion; - wd->dataType = VERSIONRSP; - wd->valueType = iSTRING; - msg.clientPtr->PushMsg(wd); + msg.clientPtr->PushMsg(new WriteData(VERSIONRSP, { { string(""), g_SystemInfo->m_ProductVersion, iSTRING } })); break; default: break; diff --git a/PrintS/DataManage/RWData.h b/PrintS/DataManage/RWData.h index 4854120..026b234 100644 --- a/PrintS/DataManage/RWData.h +++ b/PrintS/DataManage/RWData.h @@ -1,5 +1,6 @@ #pragma once #include +#include enum READTYPE { GET = 0, @@ -80,15 +81,18 @@ enum WRITETYPE { SYSPARAMDATA, // }; - -struct WriteData { - WRITETYPE dataType; - bool result; +struct Item { std::string nameKey; //参数key std::string strValue; //value DATATYPE valueType; //数据类型 +}; + +struct WriteData { + WRITETYPE dataType; //数据类型 + bool result; //执行结果 + std::list items; WriteData() {} - WriteData(WRITETYPE dt, const std::string& keyStr, const std::string& valStr) - : dataType(dt), nameKey(keyStr),strValue(valStr){} -}; + WriteData(WRITETYPE dt,const std::list& its ) + : dataType(dt), items(its){} +}; \ No newline at end of file diff --git a/PrintS/DataManage/StreamServer.cpp b/PrintS/DataManage/StreamServer.cpp index 379c740..b14ca66 100644 --- a/PrintS/DataManage/StreamServer.cpp +++ b/PrintS/DataManage/StreamServer.cpp @@ -25,7 +25,6 @@ Status StreamServer::AllStream(ServerContext* context, grpc::ServerReaderWriter< printf("%s client login...\n", addr.substr(pos+1).c_str()); cinfo->m_clientAddr = context->peer(); cinfo->m_context = context; - ClientWrapper::Instance()->AddClient(cinfo); @@ -56,9 +55,14 @@ Status StreamServer::AllStream(ServerContext* context, grpc::ServerReaderWriter< ResponseInfo response; response.set_result(true); response.set_datatype(writeData.dataType); - response.set_strvalue(writeData.strValue); - response.set_namekey(writeData.nameKey); - response.set_valuetype((::stream::ResponseInfo_TYPE)writeData.valueType); + + for (auto wd = writeData.items.begin(); wd != writeData.items.end(); ++wd) { + ::stream::ParamInfo* paramInfo = response.add_item(); + paramInfo->set_namekey((*wd).nameKey); + paramInfo->set_strvalue((*wd).strValue); + paramInfo->set_valuetype((stream::TYPE)(*wd).valueType); + } + stream->Write(response); } else { diff --git a/PrintS/Machine/Machine.h b/PrintS/Machine/Machine.h index 497e5de..efb95d2 100644 --- a/PrintS/Machine/Machine.h +++ b/PrintS/Machine/Machine.h @@ -252,7 +252,7 @@ protected: vector m_AxisTabs; - std::map m_plcMp; + //std::map m_plcMp; }; diff --git a/PrintS/PLC/CoreCommunication.cpp b/PrintS/PLC/CoreCommunication.cpp index eed2aa3..fa6d227 100644 --- a/PrintS/PLC/CoreCommunication.cpp +++ b/PrintS/PLC/CoreCommunication.cpp @@ -409,29 +409,22 @@ void CoreCommunication::GetEnvState(EnvState& envState) void CoreCommunication::SendProc() { - int index = 0; string keyStr, valStr; + DATATYPE dataType; + list its; while (!m_sendTdExitFlag) { - index = 0; std::unique_lock lock(m_ValueMtx); keyStr = valStr = ""; + its.clear(); auto param = SysParam::m_sysParamMp.begin(); while (param != SysParam::m_sysParamMp.end()) { - keyStr += param->first; - valStr += param->second.GetValue(); - ++index; - if (index % 30 == 0) { - WriteData* wd = new WriteData(); - ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, keyStr, valStr)); - keyStr = valStr = ""; - } + keyStr = param->first; + valStr = param->second.GetValue(dataType); + its.emplace_back(Item{keyStr,valStr,dataType}); ++param; } - if (!keyStr.empty() && !valStr.empty()) { - ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, keyStr, valStr)); - } + ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, its)); - index = 0; keyStr = valStr = ""; diff --git a/PrintS/PLC/SysParam.h b/PrintS/PLC/SysParam.h index 2ec7b40..35f6938 100644 --- a/PrintS/PLC/SysParam.h +++ b/PrintS/PLC/SysParam.h @@ -169,13 +169,13 @@ struct DValue { //printf("SysParamFloat init"); } - std::string GetValue() { - if (sysParamB) return std::to_string(sysParamB->GetValue())+"_"+to_string(DATATYPE::iBOOL); - if (sysParamW) return std::to_string(sysParamW->GetValue())+"_"+to_string(iSHORT); - if (sysParamI) return std::to_string(sysParamI->GetValue()) + "_" + to_string(iINT); - if (sysParamF) return std::to_string(sysParamF->GetValue()) + "_" + to_string(iFLOAT); - if (sysParamFU) return std::to_string(sysParamFU->GetValue()) + "_" + to_string(iFLOAT); - if (sysParamWU) return std::to_string(sysParamWU->GetValue()) + "_" + to_string(iSHORT); + std::string GetValue(DATATYPE& dt) { + if (sysParamB) { dt = iBOOL; return std::to_string(sysParamB->GetValue());} + if (sysParamW) { dt = iSHORT; return std::to_string(sysParamW->GetValue());} + if (sysParamI) { dt = iINT; return std::to_string(sysParamI->GetValue());} + if (sysParamF) { dt = iFLOAT; return std::to_string(sysParamF->GetValue());} + if (sysParamFU) { dt = iFLOAT; return std::to_string(sysParamFU->GetValue());} + if (sysParamWU) { dt = iSHORT; return std::to_string(sysParamWU->GetValue());} return ""; } diff --git a/PrintS/protobuf/stream.pb.cc b/PrintS/protobuf/stream.pb.cc index 49f0256..772076e 100644 --- a/PrintS/protobuf/stream.pb.cc +++ b/PrintS/protobuf/stream.pb.cc @@ -22,6 +22,30 @@ namespace _pbi = ::google::protobuf::internal; namespace _fl = ::google::protobuf::internal::field_layout; namespace stream { template +PROTOBUF_CONSTEXPR ParamInfo::ParamInfo(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_.namekey_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.strvalue_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.valuetype_)*/ 0, + /*decltype(_impl_._cached_size_)*/ {}, + } {} +struct ParamInfoDefaultTypeInternal { + PROTOBUF_CONSTEXPR ParamInfoDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ParamInfoDefaultTypeInternal() {} + union { + ParamInfo _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ParamInfoDefaultTypeInternal _ParamInfo_default_instance_; + template PROTOBUF_CONSTEXPR RequestInfo::RequestInfo(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_.namekey_)*/ { @@ -49,17 +73,9 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT template PROTOBUF_CONSTEXPR ResponseInfo::ResponseInfo(::_pbi::ConstantInitialized) : _impl_{ - /*decltype(_impl_.namekey_)*/ { - &::_pbi::fixed_address_empty_string, - ::_pbi::ConstantInitialized{}, - }, - /*decltype(_impl_.strvalue_)*/ { - &::_pbi::fixed_address_empty_string, - ::_pbi::ConstantInitialized{}, - }, + /*decltype(_impl_.item_)*/ {}, /*decltype(_impl_.datatype_)*/ 0u, /*decltype(_impl_.result_)*/ false, - /*decltype(_impl_.valuetype_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}, } {} struct ResponseInfoDefaultTypeInternal { @@ -73,13 +89,24 @@ struct ResponseInfoDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseInfoDefaultTypeInternal _ResponseInfo_default_instance_; } // namespace stream -static ::_pb::Metadata file_level_metadata_stream_2eproto[2]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[2]; +static ::_pb::Metadata file_level_metadata_stream_2eproto[3]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_stream_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_stream_2eproto = nullptr; const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.namekey_), + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.strvalue_), + PROTOBUF_FIELD_OFFSET(::stream::ParamInfo, _impl_.valuetype_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::stream::RequestInfo, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -101,53 +128,52 @@ const ::uint32_t TableStruct_stream_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.datatype_), PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.result_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.namekey_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.strvalue_), - PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.valuetype_), + PROTOBUF_FIELD_OFFSET(::stream::ResponseInfo, _impl_.item_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::stream::RequestInfo)}, - {12, -1, -1, sizeof(::stream::ResponseInfo)}, + {0, -1, -1, sizeof(::stream::ParamInfo)}, + {11, -1, -1, sizeof(::stream::RequestInfo)}, + {23, -1, -1, sizeof(::stream::ResponseInfo)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::stream::_ParamInfo_default_instance_._instance, &::stream::_RequestInfo_default_instance_._instance, &::stream::_ResponseInfo_default_instance_._instance, }; const char descriptor_table_protodef_stream_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\014stream.proto\022\006stream\"\311\001\n\013RequestInfo\022\020" + "\n\014stream.proto\022\006stream\"O\n\tParamInfo\022\017\n\007n" + "ameKey\030\001 \001(\014\022\020\n\010strValue\030\002 \001(\014\022\037\n\tvalueT" + "ype\030\003 \001(\0162\014.stream.TYPE\"c\n\013RequestInfo\022\020" "\n\010dataType\030\001 \001(\r\022\017\n\007nameKey\030\002 \001(\014\022\020\n\010str" - "Value\030\003 \001(\014\022+\n\tvalueType\030\004 \001(\0162\030.stream." - "RequestInfo.TYPE\"X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006i" - "SHORT\020\001\022\013\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020" - "\004\022\n\n\006iFLOAT\020\005\022\013\n\007iSTRING\020\006\"\333\001\n\014ResponseI" - "nfo\022\020\n\010dataType\030\001 \001(\r\022\016\n\006result\030\002 \001(\010\022\017\n" - "\007nameKey\030\003 \001(\014\022\020\n\010strValue\030\004 \001(\014\022,\n\tvalu" - "eType\030\005 \001(\0162\031.stream.ResponseInfo.TYPE\"X" - "\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013\n\007iUSHORT" - "\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLOAT\020\005\022\013\n\007i" - "STRING\020\0062\373\001\n\006Stream\0225\n\006Simple\022\023.stream.R" - "equestInfo\032\024.stream.ResponseInfo\"\000\022=\n\014Se" - "rverStream\022\023.stream.RequestInfo\032\024.stream" - ".ResponseInfo\"\0000\001\022=\n\014ClientStream\022\023.stre" - "am.RequestInfo\032\024.stream.ResponseInfo\"\000(\001" - "\022<\n\tAllStream\022\023.stream.RequestInfo\032\024.str" - "eam.ResponseInfo\"\000(\0010\001B-\n\027io.grpc.exampl" - "es.streamB\013StreamProtoP\001\242\002\002STb\006proto3" + "Value\030\003 \001(\014\022\037\n\tvalueType\030\004 \001(\0162\014.stream." + "TYPE\"Q\n\014ResponseInfo\022\020\n\010dataType\030\001 \001(\r\022\016" + "\n\006result\030\002 \001(\010\022\037\n\004item\030\003 \003(\0132\021.stream.Pa" + "ramInfo*X\n\004TYPE\022\t\n\005iBOOL\020\000\022\n\n\006iSHORT\020\001\022\013" + "\n\007iUSHORT\020\002\022\010\n\004iINT\020\003\022\t\n\005iUINT\020\004\022\n\n\006iFLO" + "AT\020\005\022\013\n\007iSTRING\020\0062\373\001\n\006Stream\0225\n\006Simple\022\023" + ".stream.RequestInfo\032\024.stream.ResponseInf" + "o\"\000\022=\n\014ServerStream\022\023.stream.RequestInfo" + "\032\024.stream.ResponseInfo\"\0000\001\022=\n\014ClientStre" + "am\022\023.stream.RequestInfo\032\024.stream.Respons" + "eInfo\"\000(\001\022<\n\tAllStream\022\023.stream.RequestI" + "nfo\032\024.stream.ResponseInfo\"\000(\0010\001B-\n\027io.gr" + "pc.examples.streamB\013StreamProtoP\001\242\002\002STb\006" + "proto3" }; static ::absl::once_flag descriptor_table_stream_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_stream_2eproto = { false, false, - 757, + 686, descriptor_table_protodef_stream_2eproto, "stream.proto", &descriptor_table_stream_2eproto_once, nullptr, 0, - 2, + 3, schemas, file_default_instances, TableStruct_stream_2eproto::offsets, @@ -174,11 +200,11 @@ PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_stream_2 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_stream_2eproto(&descriptor_table_stream_2eproto); namespace stream { -const ::google::protobuf::EnumDescriptor* RequestInfo_TYPE_descriptor() { +const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto); return file_level_enum_descriptors_stream_2eproto[0]; } -bool RequestInfo_TYPE_IsValid(int value) { +bool TYPE_IsValid(int value) { switch (value) { case 0: case 1: @@ -192,56 +218,258 @@ bool RequestInfo_TYPE_IsValid(int value) { return false; } } -#if (__cplusplus < 201703) && \ - (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +// =================================================================== -constexpr RequestInfo_TYPE RequestInfo::iBOOL; -constexpr RequestInfo_TYPE RequestInfo::iSHORT; -constexpr RequestInfo_TYPE RequestInfo::iUSHORT; -constexpr RequestInfo_TYPE RequestInfo::iINT; -constexpr RequestInfo_TYPE RequestInfo::iUINT; -constexpr RequestInfo_TYPE RequestInfo::iFLOAT; -constexpr RequestInfo_TYPE RequestInfo::iSTRING; -constexpr RequestInfo_TYPE RequestInfo::TYPE_MIN; -constexpr RequestInfo_TYPE RequestInfo::TYPE_MAX; -constexpr int RequestInfo::TYPE_ARRAYSIZE; +class ParamInfo::_Internal { + public: +}; -#endif // (__cplusplus < 201703) && - // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::google::protobuf::EnumDescriptor* ResponseInfo_TYPE_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_stream_2eproto); - return file_level_enum_descriptors_stream_2eproto[1]; +ParamInfo::ParamInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:stream.ParamInfo) } -bool ResponseInfo_TYPE_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - return true; - default: - return false; +ParamInfo::ParamInfo(const ParamInfo& from) : ::google::protobuf::Message() { + ParamInfo* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.namekey_){}, + decltype(_impl_.strvalue_){}, + decltype(_impl_.valuetype_){}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_.namekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.namekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_namekey().empty()) { + _this->_impl_.namekey_.Set(from._internal_namekey(), _this->GetArenaForAllocation()); } + _impl_.strvalue_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_strvalue().empty()) { + _this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation()); + } + _this->_impl_.valuetype_ = from._impl_.valuetype_; + + // @@protoc_insertion_point(copy_constructor:stream.ParamInfo) +} +inline void ParamInfo::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_.namekey_){}, + decltype(_impl_.strvalue_){}, + decltype(_impl_.valuetype_){0}, + /*decltype(_impl_._cached_size_)*/ {}, + }; + _impl_.namekey_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.namekey_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.strvalue_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +ParamInfo::~ParamInfo() { + // @@protoc_insertion_point(destructor:stream.ParamInfo) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void ParamInfo::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.namekey_.Destroy(); + _impl_.strvalue_.Destroy(); +} +void ParamInfo::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); } -#if (__cplusplus < 201703) && \ - (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -constexpr ResponseInfo_TYPE ResponseInfo::iBOOL; -constexpr ResponseInfo_TYPE ResponseInfo::iSHORT; -constexpr ResponseInfo_TYPE ResponseInfo::iUSHORT; -constexpr ResponseInfo_TYPE ResponseInfo::iINT; -constexpr ResponseInfo_TYPE ResponseInfo::iUINT; -constexpr ResponseInfo_TYPE ResponseInfo::iFLOAT; -constexpr ResponseInfo_TYPE ResponseInfo::iSTRING; -constexpr ResponseInfo_TYPE ResponseInfo::TYPE_MIN; -constexpr ResponseInfo_TYPE ResponseInfo::TYPE_MAX; -constexpr int ResponseInfo::TYPE_ARRAYSIZE; +PROTOBUF_NOINLINE void ParamInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:stream.ParamInfo) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; -#endif // (__cplusplus < 201703) && - // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + _impl_.namekey_.ClearToEmpty(); + _impl_.strvalue_.ClearToEmpty(); + _impl_.valuetype_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* ParamInfo::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 0, 2> ParamInfo::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_ParamInfo_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // bytes nameKey = 1; + {::_pbi::TcParser::FastBS1, + {10, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.namekey_)}}, + // bytes strValue = 2; + {::_pbi::TcParser::FastBS1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.strvalue_)}}, + // .stream.TYPE valueType = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ParamInfo, _impl_.valuetype_), 63>(), + {24, 63, 0, PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.valuetype_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // bytes nameKey = 1; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.namekey_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, + // bytes strValue = 2; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.strvalue_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, + // .stream.TYPE valueType = 3; + {PROTOBUF_FIELD_OFFSET(ParamInfo, _impl_.valuetype_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + }}, +}; + +::uint8_t* ParamInfo::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:stream.ParamInfo) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // bytes nameKey = 1; + if (!this->_internal_namekey().empty()) { + const std::string& _s = this->_internal_namekey(); + target = stream->WriteBytesMaybeAliased(1, _s, target); + } + + // bytes strValue = 2; + if (!this->_internal_strvalue().empty()) { + const std::string& _s = this->_internal_strvalue(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + + // .stream.TYPE valueType = 3; + if (this->_internal_valuetype() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_valuetype(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:stream.ParamInfo) + return target; +} + +::size_t ParamInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:stream.ParamInfo) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bytes nameKey = 1; + if (!this->_internal_namekey().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->_internal_namekey()); + } + + // bytes strValue = 2; + if (!this->_internal_strvalue().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->_internal_strvalue()); + } + + // .stream.TYPE valueType = 3; + if (this->_internal_valuetype() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData ParamInfo::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + ParamInfo::MergeImpl +}; +const ::google::protobuf::Message::ClassData*ParamInfo::GetClassData() const { return &_class_data_; } + + +void ParamInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:stream.ParamInfo) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_namekey().empty()) { + _this->_internal_set_namekey(from._internal_namekey()); + } + if (!from._internal_strvalue().empty()) { + _this->_internal_set_strvalue(from._internal_strvalue()); + } + if (from._internal_valuetype() != 0) { + _this->_internal_set_valuetype(from._internal_valuetype()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void ParamInfo::CopyFrom(const ParamInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:stream.ParamInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool ParamInfo::IsInitialized() const { + return true; +} + +void ParamInfo::InternalSwap(ParamInfo* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.namekey_, lhs_arena, + &other->_impl_.namekey_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena, + &other->_impl_.strvalue_, rhs_arena); + swap(_impl_.valuetype_, other->_impl_.valuetype_); +} + +::google::protobuf::Metadata ParamInfo::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, + file_level_metadata_stream_2eproto[0]); +} // =================================================================== class RequestInfo::_Internal { @@ -353,7 +581,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { &_RequestInfo_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RequestInfo, _impl_.valuetype_), 63>(), {32, 63, 0, PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_)}}, // uint32 dataType = 1; @@ -377,7 +605,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { // bytes strValue = 3; {PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.strvalue_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; {PROTOBUF_FIELD_OFFSET(RequestInfo, _impl_.valuetype_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, }}, @@ -412,7 +640,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { target = stream->WriteBytesMaybeAliased(3, _s, target); } - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; if (this->_internal_valuetype() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -454,7 +682,7 @@ const ::_pbi::TcParseTable<2, 4, 0, 0, 2> RequestInfo::_table_ = { this->_internal_datatype()); } - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; if (this->_internal_valuetype() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); @@ -524,7 +752,7 @@ void RequestInfo::InternalSwap(RequestInfo* other) { ::google::protobuf::Metadata RequestInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, - file_level_metadata_stream_2eproto[0]); + file_level_metadata_stream_2eproto[1]); } // =================================================================== @@ -541,53 +769,27 @@ ResponseInfo::ResponseInfo(const ResponseInfo& from) : ::google::protobuf::Messa ResponseInfo* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.namekey_){}, - decltype(_impl_.strvalue_){}, + decltype(_impl_.item_){from._impl_.item_}, decltype(_impl_.datatype_){}, decltype(_impl_.result_){}, - decltype(_impl_.valuetype_){}, /*decltype(_impl_._cached_size_)*/ {}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); - _impl_.namekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.namekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_namekey().empty()) { - _this->_impl_.namekey_.Set(from._internal_namekey(), _this->GetArenaForAllocation()); - } - _impl_.strvalue_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_strvalue().empty()) { - _this->_impl_.strvalue_.Set(from._internal_strvalue(), _this->GetArenaForAllocation()); - } ::memcpy(&_impl_.datatype_, &from._impl_.datatype_, - static_cast<::size_t>(reinterpret_cast(&_impl_.valuetype_) - - reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.valuetype_)); + static_cast<::size_t>(reinterpret_cast(&_impl_.result_) - + reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.result_)); // @@protoc_insertion_point(copy_constructor:stream.ResponseInfo) } inline void ResponseInfo::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ - decltype(_impl_.namekey_){}, - decltype(_impl_.strvalue_){}, + decltype(_impl_.item_){arena}, decltype(_impl_.datatype_){0u}, decltype(_impl_.result_){false}, - decltype(_impl_.valuetype_){0}, /*decltype(_impl_._cached_size_)*/ {}, }; - _impl_.namekey_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.namekey_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.strvalue_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } ResponseInfo::~ResponseInfo() { // @@protoc_insertion_point(destructor:stream.ResponseInfo) @@ -596,8 +798,7 @@ ResponseInfo::~ResponseInfo() { } inline void ResponseInfo::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.namekey_.Destroy(); - _impl_.strvalue_.Destroy(); + _impl_.item_.~RepeatedPtrField(); } void ResponseInfo::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -609,11 +810,10 @@ PROTOBUF_NOINLINE void ResponseInfo::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.namekey_.ClearToEmpty(); - _impl_.strvalue_.ClearToEmpty(); + _internal_mutable_item()->Clear(); ::memset(&_impl_.datatype_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.valuetype_) - - reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.valuetype_)); + reinterpret_cast(&_impl_.result_) - + reinterpret_cast(&_impl_.datatype_)) + sizeof(_impl_.result_)); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -625,17 +825,17 @@ const char* ResponseInfo::_InternalParse( PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { +const ::_pbi::TcParseTable<2, 3, 1, 0, 2> ResponseInfo::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries + 3, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), &_ResponseInfo_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ @@ -646,17 +846,9 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // bool result = 2; {::_pbi::TcParser::SingularVarintNoZag1(), {16, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_)}}, - // bytes nameKey = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.namekey_)}}, - // bytes strValue = 4; - {::_pbi::TcParser::FastBS1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.strvalue_)}}, - // .stream.ResponseInfo.TYPE valueType = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ResponseInfo, _impl_.valuetype_), 63>(), - {40, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, + // repeated .stream.ParamInfo item = 3; + {::_pbi::TcParser::FastMtR1, + {26, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.item_)}}, }}, {{ 65535, 65535 }}, {{ @@ -666,18 +858,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // bool result = 2; {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bytes nameKey = 3; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.namekey_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes strValue = 4; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.strvalue_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // .stream.ResponseInfo.TYPE valueType = 5; - {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - }}, - // no aux_entries - {{ + // repeated .stream.ParamInfo item = 3; + {PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.item_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::stream::ParamInfo>()}, + }}, {{ }}, }; @@ -702,23 +888,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { 2, this->_internal_result(), target); } - // bytes nameKey = 3; - if (!this->_internal_namekey().empty()) { - const std::string& _s = this->_internal_namekey(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // bytes strValue = 4; - if (!this->_internal_strvalue().empty()) { - const std::string& _s = this->_internal_strvalue(); - target = stream->WriteBytesMaybeAliased(4, _s, target); - } - - // .stream.ResponseInfo.TYPE valueType = 5; - if (this->_internal_valuetype() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 5, this->_internal_valuetype(), target); + // repeated .stream.ParamInfo item = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_item_size()); i < n; i++) { + const auto& repfield = this->_internal_item().Get(i); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -738,18 +913,12 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // bytes nameKey = 3; - if (!this->_internal_namekey().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_namekey()); + // repeated .stream.ParamInfo item = 3; + total_size += 1UL * this->_internal_item_size(); + for (const auto& msg : this->_internal_item()) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - - // bytes strValue = 4; - if (!this->_internal_strvalue().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_strvalue()); - } - // uint32 dataType = 1; if (this->_internal_datatype() != 0) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( @@ -761,12 +930,6 @@ const ::_pbi::TcParseTable<3, 5, 0, 0, 2> ResponseInfo::_table_ = { total_size += 2; } - // .stream.ResponseInfo.TYPE valueType = 5; - if (this->_internal_valuetype() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_valuetype()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -785,21 +948,13 @@ void ResponseInfo::MergeImpl(::google::protobuf::Message& to_msg, const ::google ::uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_namekey().empty()) { - _this->_internal_set_namekey(from._internal_namekey()); - } - if (!from._internal_strvalue().empty()) { - _this->_internal_set_strvalue(from._internal_strvalue()); - } + _this->_internal_mutable_item()->MergeFrom(from._internal_item()); if (from._internal_datatype() != 0) { _this->_internal_set_datatype(from._internal_datatype()); } if (from._internal_result() != 0) { _this->_internal_set_result(from._internal_result()); } - if (from._internal_valuetype() != 0) { - _this->_internal_set_valuetype(from._internal_valuetype()); - } _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -816,16 +971,11 @@ PROTOBUF_NOINLINE bool ResponseInfo::IsInitialized() const { void ResponseInfo::InternalSwap(ResponseInfo* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.namekey_, lhs_arena, - &other->_impl_.namekey_, rhs_arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.strvalue_, lhs_arena, - &other->_impl_.strvalue_, rhs_arena); + _impl_.item_.InternalSwap(&other->_impl_.item_); ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.valuetype_) - + sizeof(ResponseInfo::_impl_.valuetype_) + PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.result_) + + sizeof(ResponseInfo::_impl_.result_) - PROTOBUF_FIELD_OFFSET(ResponseInfo, _impl_.datatype_)>( reinterpret_cast(&_impl_.datatype_), reinterpret_cast(&other->_impl_.datatype_)); @@ -834,7 +984,7 @@ void ResponseInfo::InternalSwap(ResponseInfo* other) { ::google::protobuf::Metadata ResponseInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_stream_2eproto_getter, &descriptor_table_stream_2eproto_once, - file_level_metadata_stream_2eproto[1]); + file_level_metadata_stream_2eproto[2]); } // @@protoc_insertion_point(namespace_scope) } // namespace stream diff --git a/PrintS/protobuf/stream.pb.h b/PrintS/protobuf/stream.pb.h index 7da7bbe..635d478 100644 --- a/PrintS/protobuf/stream.pb.h +++ b/PrintS/protobuf/stream.pb.h @@ -55,6 +55,9 @@ struct TableStruct_stream_2eproto { extern const ::google::protobuf::internal::DescriptorTable descriptor_table_stream_2eproto; namespace stream { +class ParamInfo; +struct ParamInfoDefaultTypeInternal; +extern ParamInfoDefaultTypeInternal _ParamInfo_default_instance_; class RequestInfo; struct RequestInfoDefaultTypeInternal; extern RequestInfoDefaultTypeInternal _RequestInfo_default_instance_; @@ -68,79 +71,42 @@ namespace protobuf { } // namespace google namespace stream { -enum RequestInfo_TYPE : int { - RequestInfo_TYPE_iBOOL = 0, - RequestInfo_TYPE_iSHORT = 1, - RequestInfo_TYPE_iUSHORT = 2, - RequestInfo_TYPE_iINT = 3, - RequestInfo_TYPE_iUINT = 4, - RequestInfo_TYPE_iFLOAT = 5, - RequestInfo_TYPE_iSTRING = 6, - RequestInfo_TYPE_RequestInfo_TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = +enum TYPE : int { + iBOOL = 0, + iSHORT = 1, + iUSHORT = 2, + iINT = 3, + iUINT = 4, + iFLOAT = 5, + iSTRING = 6, + TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::min(), - RequestInfo_TYPE_RequestInfo_TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = + TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::int32_t>::max(), }; -bool RequestInfo_TYPE_IsValid(int value); -constexpr RequestInfo_TYPE RequestInfo_TYPE_TYPE_MIN = static_cast(0); -constexpr RequestInfo_TYPE RequestInfo_TYPE_TYPE_MAX = static_cast(6); -constexpr int RequestInfo_TYPE_TYPE_ARRAYSIZE = 6 + 1; +bool TYPE_IsValid(int value); +constexpr TYPE TYPE_MIN = static_cast(0); +constexpr TYPE TYPE_MAX = static_cast(6); +constexpr int TYPE_ARRAYSIZE = 6 + 1; const ::google::protobuf::EnumDescriptor* -RequestInfo_TYPE_descriptor(); +TYPE_descriptor(); template -const std::string& RequestInfo_TYPE_Name(T value) { - static_assert(std::is_same::value || +const std::string& TYPE_Name(T value) { + static_assert(std::is_same::value || std::is_integral::value, "Incorrect type passed to TYPE_Name()."); - return RequestInfo_TYPE_Name(static_cast(value)); + return TYPE_Name(static_cast(value)); } template <> -inline const std::string& RequestInfo_TYPE_Name(RequestInfo_TYPE value) { - return ::google::protobuf::internal::NameOfDenseEnum( static_cast(value)); } -inline bool RequestInfo_TYPE_Parse(absl::string_view name, RequestInfo_TYPE* value) { - return ::google::protobuf::internal::ParseNamedEnum( - RequestInfo_TYPE_descriptor(), name, value); -} -enum ResponseInfo_TYPE : int { - ResponseInfo_TYPE_iBOOL = 0, - ResponseInfo_TYPE_iSHORT = 1, - ResponseInfo_TYPE_iUSHORT = 2, - ResponseInfo_TYPE_iINT = 3, - ResponseInfo_TYPE_iUINT = 4, - ResponseInfo_TYPE_iFLOAT = 5, - ResponseInfo_TYPE_iSTRING = 6, - ResponseInfo_TYPE_ResponseInfo_TYPE_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - ResponseInfo_TYPE_ResponseInfo_TYPE_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool ResponseInfo_TYPE_IsValid(int value); -constexpr ResponseInfo_TYPE ResponseInfo_TYPE_TYPE_MIN = static_cast(0); -constexpr ResponseInfo_TYPE ResponseInfo_TYPE_TYPE_MAX = static_cast(6); -constexpr int ResponseInfo_TYPE_TYPE_ARRAYSIZE = 6 + 1; -const ::google::protobuf::EnumDescriptor* -ResponseInfo_TYPE_descriptor(); -template -const std::string& ResponseInfo_TYPE_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to TYPE_Name()."); - return ResponseInfo_TYPE_Name(static_cast(value)); -} -template <> -inline const std::string& ResponseInfo_TYPE_Name(ResponseInfo_TYPE value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool ResponseInfo_TYPE_Parse(absl::string_view name, ResponseInfo_TYPE* value) { - return ::google::protobuf::internal::ParseNamedEnum( - ResponseInfo_TYPE_descriptor(), name, value); +inline bool TYPE_Parse(absl::string_view name, TYPE* value) { + return ::google::protobuf::internal::ParseNamedEnum( + TYPE_descriptor(), name, value); } // =================================================================== @@ -148,6 +114,200 @@ inline bool ResponseInfo_TYPE_Parse(absl::string_view name, ResponseInfo_TYPE* v // ------------------------------------------------------------------- +class ParamInfo final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.ParamInfo) */ { + public: + inline ParamInfo() : ParamInfo(nullptr) {} + ~ParamInfo() override; + template + explicit PROTOBUF_CONSTEXPR ParamInfo(::google::protobuf::internal::ConstantInitialized); + + ParamInfo(const ParamInfo& from); + ParamInfo(ParamInfo&& from) noexcept + : ParamInfo() { + *this = ::std::move(from); + } + + inline ParamInfo& operator=(const ParamInfo& from) { + CopyFrom(from); + return *this; + } + inline ParamInfo& operator=(ParamInfo&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ParamInfo& default_instance() { + return *internal_default_instance(); + } + static inline const ParamInfo* internal_default_instance() { + return reinterpret_cast( + &_ParamInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(ParamInfo& a, ParamInfo& b) { + a.Swap(&b); + } + inline void Swap(ParamInfo* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ParamInfo* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ParamInfo* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const ParamInfo& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const ParamInfo& from) { + ParamInfo::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ParamInfo* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "stream.ParamInfo"; + } + protected: + explicit ParamInfo(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameKeyFieldNumber = 1, + kStrValueFieldNumber = 2, + kValueTypeFieldNumber = 3, + }; + // bytes nameKey = 1; + void clear_namekey() ; + const std::string& namekey() const; + template + void set_namekey(Arg_&& arg, Args_... args); + std::string* mutable_namekey(); + PROTOBUF_NODISCARD std::string* release_namekey(); + void set_allocated_namekey(std::string* ptr); + + private: + const std::string& _internal_namekey() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_namekey( + const std::string& value); + std::string* _internal_mutable_namekey(); + + public: + // bytes strValue = 2; + void clear_strvalue() ; + const std::string& strvalue() const; + template + void set_strvalue(Arg_&& arg, Args_... args); + std::string* mutable_strvalue(); + PROTOBUF_NODISCARD std::string* release_strvalue(); + void set_allocated_strvalue(std::string* ptr); + + private: + const std::string& _internal_strvalue() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_strvalue( + const std::string& value); + std::string* _internal_mutable_strvalue(); + + public: + // .stream.TYPE valueType = 3; + void clear_valuetype() ; + ::stream::TYPE valuetype() const; + void set_valuetype(::stream::TYPE value); + + private: + ::stream::TYPE _internal_valuetype() const; + void _internal_set_valuetype(::stream::TYPE value); + + public: + // @@protoc_insertion_point(class_scope:stream.ParamInfo) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ArenaStringPtr namekey_; + ::google::protobuf::internal::ArenaStringPtr strvalue_; + int valuetype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_stream_2eproto; +};// ------------------------------------------------------------------- + class RequestInfo final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:stream.RequestInfo) */ { public: @@ -204,7 +364,7 @@ class RequestInfo final : &_RequestInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(RequestInfo& a, RequestInfo& b) { a.Swap(&b); @@ -273,31 +433,6 @@ class RequestInfo final : // nested types ---------------------------------------------------- - using TYPE = RequestInfo_TYPE; - static constexpr TYPE iBOOL = RequestInfo_TYPE_iBOOL; - static constexpr TYPE iSHORT = RequestInfo_TYPE_iSHORT; - static constexpr TYPE iUSHORT = RequestInfo_TYPE_iUSHORT; - static constexpr TYPE iINT = RequestInfo_TYPE_iINT; - static constexpr TYPE iUINT = RequestInfo_TYPE_iUINT; - static constexpr TYPE iFLOAT = RequestInfo_TYPE_iFLOAT; - static constexpr TYPE iSTRING = RequestInfo_TYPE_iSTRING; - static inline bool TYPE_IsValid(int value) { - return RequestInfo_TYPE_IsValid(value); - } - static constexpr TYPE TYPE_MIN = RequestInfo_TYPE_TYPE_MIN; - static constexpr TYPE TYPE_MAX = RequestInfo_TYPE_TYPE_MAX; - static constexpr int TYPE_ARRAYSIZE = RequestInfo_TYPE_TYPE_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { - return RequestInfo_TYPE_descriptor(); - } - template - static inline const std::string& TYPE_Name(T value) { - return RequestInfo_TYPE_Name(value); - } - static inline bool TYPE_Parse(absl::string_view name, TYPE* value) { - return RequestInfo_TYPE_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { @@ -348,14 +483,14 @@ class RequestInfo final : void _internal_set_datatype(::uint32_t value); public: - // .stream.RequestInfo.TYPE valueType = 4; + // .stream.TYPE valueType = 4; void clear_valuetype() ; - ::stream::RequestInfo_TYPE valuetype() const; - void set_valuetype(::stream::RequestInfo_TYPE value); + ::stream::TYPE valuetype() const; + void set_valuetype(::stream::TYPE value); private: - ::stream::RequestInfo_TYPE _internal_valuetype() const; - void _internal_set_valuetype(::stream::RequestInfo_TYPE value); + ::stream::TYPE _internal_valuetype() const; + void _internal_set_valuetype(::stream::TYPE value); public: // @@protoc_insertion_point(class_scope:stream.RequestInfo) @@ -435,7 +570,7 @@ class ResponseInfo final : &_ResponseInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(ResponseInfo& a, ResponseInfo& b) { a.Swap(&b); @@ -504,72 +639,31 @@ class ResponseInfo final : // nested types ---------------------------------------------------- - using TYPE = ResponseInfo_TYPE; - static constexpr TYPE iBOOL = ResponseInfo_TYPE_iBOOL; - static constexpr TYPE iSHORT = ResponseInfo_TYPE_iSHORT; - static constexpr TYPE iUSHORT = ResponseInfo_TYPE_iUSHORT; - static constexpr TYPE iINT = ResponseInfo_TYPE_iINT; - static constexpr TYPE iUINT = ResponseInfo_TYPE_iUINT; - static constexpr TYPE iFLOAT = ResponseInfo_TYPE_iFLOAT; - static constexpr TYPE iSTRING = ResponseInfo_TYPE_iSTRING; - static inline bool TYPE_IsValid(int value) { - return ResponseInfo_TYPE_IsValid(value); - } - static constexpr TYPE TYPE_MIN = ResponseInfo_TYPE_TYPE_MIN; - static constexpr TYPE TYPE_MAX = ResponseInfo_TYPE_TYPE_MAX; - static constexpr int TYPE_ARRAYSIZE = ResponseInfo_TYPE_TYPE_ARRAYSIZE; - static inline const ::google::protobuf::EnumDescriptor* TYPE_descriptor() { - return ResponseInfo_TYPE_descriptor(); - } - template - static inline const std::string& TYPE_Name(T value) { - return ResponseInfo_TYPE_Name(value); - } - static inline bool TYPE_Parse(absl::string_view name, TYPE* value) { - return ResponseInfo_TYPE_Parse(name, value); - } - // accessors ------------------------------------------------------- enum : int { - kNameKeyFieldNumber = 3, - kStrValueFieldNumber = 4, + kItemFieldNumber = 3, kDataTypeFieldNumber = 1, kResultFieldNumber = 2, - kValueTypeFieldNumber = 5, }; - // bytes nameKey = 3; - void clear_namekey() ; - const std::string& namekey() const; - template - void set_namekey(Arg_&& arg, Args_... args); - std::string* mutable_namekey(); - PROTOBUF_NODISCARD std::string* release_namekey(); - void set_allocated_namekey(std::string* ptr); - + // repeated .stream.ParamInfo item = 3; + int item_size() const; private: - const std::string& _internal_namekey() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_namekey( - const std::string& value); - std::string* _internal_mutable_namekey(); + int _internal_item_size() const; public: - // bytes strValue = 4; - void clear_strvalue() ; - const std::string& strvalue() const; - template - void set_strvalue(Arg_&& arg, Args_... args); - std::string* mutable_strvalue(); - PROTOBUF_NODISCARD std::string* release_strvalue(); - void set_allocated_strvalue(std::string* ptr); - + void clear_item() ; + ::stream::ParamInfo* mutable_item(int index); + ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >* + mutable_item(); private: - const std::string& _internal_strvalue() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_strvalue( - const std::string& value); - std::string* _internal_mutable_strvalue(); - + const ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>& _internal_item() const; + ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>* _internal_mutable_item(); public: + const ::stream::ParamInfo& item(int index) const; + ::stream::ParamInfo* add_item(); + const ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >& + item() const; // uint32 dataType = 1; void clear_datatype() ; ::uint32_t datatype() const; @@ -589,32 +683,20 @@ class ResponseInfo final : bool _internal_result() const; void _internal_set_result(bool value); - public: - // .stream.ResponseInfo.TYPE valueType = 5; - void clear_valuetype() ; - ::stream::ResponseInfo_TYPE valuetype() const; - void set_valuetype(::stream::ResponseInfo_TYPE value); - - private: - ::stream::ResponseInfo_TYPE _internal_valuetype() const; - void _internal_set_valuetype(::stream::ResponseInfo_TYPE value); - public: // @@protoc_insertion_point(class_scope:stream.ResponseInfo) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, 0, 0, 2> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 3, 1, 0, 2> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::google::protobuf::internal::ArenaStringPtr namekey_; - ::google::protobuf::internal::ArenaStringPtr strvalue_; + ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo > item_; ::uint32_t datatype_; bool result_; - int valuetype_; mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -636,6 +718,134 @@ class ResponseInfo final : #endif // __GNUC__ // ------------------------------------------------------------------- +// ParamInfo + +// bytes nameKey = 1; +inline void ParamInfo::clear_namekey() { + _impl_.namekey_.ClearToEmpty(); +} +inline const std::string& ParamInfo::namekey() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.nameKey) + return _internal_namekey(); +} +template +inline PROTOBUF_ALWAYS_INLINE void ParamInfo::set_namekey(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.namekey_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:stream.ParamInfo.nameKey) +} +inline std::string* ParamInfo::mutable_namekey() { + std::string* _s = _internal_mutable_namekey(); + // @@protoc_insertion_point(field_mutable:stream.ParamInfo.nameKey) + return _s; +} +inline const std::string& ParamInfo::_internal_namekey() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.namekey_.Get(); +} +inline void ParamInfo::_internal_set_namekey(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.namekey_.Set(value, GetArenaForAllocation()); +} +inline std::string* ParamInfo::_internal_mutable_namekey() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.namekey_.Mutable( GetArenaForAllocation()); +} +inline std::string* ParamInfo::release_namekey() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:stream.ParamInfo.nameKey) + return _impl_.namekey_.Release(); +} +inline void ParamInfo::set_allocated_namekey(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.namekey_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.namekey_.IsDefault()) { + _impl_.namekey_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:stream.ParamInfo.nameKey) +} + +// bytes strValue = 2; +inline void ParamInfo::clear_strvalue() { + _impl_.strvalue_.ClearToEmpty(); +} +inline const std::string& ParamInfo::strvalue() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.strValue) + return _internal_strvalue(); +} +template +inline PROTOBUF_ALWAYS_INLINE void ParamInfo::set_strvalue(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.strvalue_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:stream.ParamInfo.strValue) +} +inline std::string* ParamInfo::mutable_strvalue() { + std::string* _s = _internal_mutable_strvalue(); + // @@protoc_insertion_point(field_mutable:stream.ParamInfo.strValue) + return _s; +} +inline const std::string& ParamInfo::_internal_strvalue() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.strvalue_.Get(); +} +inline void ParamInfo::_internal_set_strvalue(const std::string& value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.strvalue_.Set(value, GetArenaForAllocation()); +} +inline std::string* ParamInfo::_internal_mutable_strvalue() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + return _impl_.strvalue_.Mutable( GetArenaForAllocation()); +} +inline std::string* ParamInfo::release_strvalue() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:stream.ParamInfo.strValue) + return _impl_.strvalue_.Release(); +} +inline void ParamInfo::set_allocated_strvalue(std::string* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.strvalue_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.strvalue_.IsDefault()) { + _impl_.strvalue_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:stream.ParamInfo.strValue) +} + +// .stream.TYPE valueType = 3; +inline void ParamInfo::clear_valuetype() { + _impl_.valuetype_ = 0; +} +inline ::stream::TYPE ParamInfo::valuetype() const { + // @@protoc_insertion_point(field_get:stream.ParamInfo.valueType) + return _internal_valuetype(); +} +inline void ParamInfo::set_valuetype(::stream::TYPE value) { + _internal_set_valuetype(value); + // @@protoc_insertion_point(field_set:stream.ParamInfo.valueType) +} +inline ::stream::TYPE ParamInfo::_internal_valuetype() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return static_cast<::stream::TYPE>(_impl_.valuetype_); +} +inline void ParamInfo::_internal_set_valuetype(::stream::TYPE value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.valuetype_ = value; +} + +// ------------------------------------------------------------------- + // RequestInfo // uint32 dataType = 1; @@ -762,23 +972,23 @@ inline void RequestInfo::set_allocated_strvalue(std::string* value) { // @@protoc_insertion_point(field_set_allocated:stream.RequestInfo.strValue) } -// .stream.RequestInfo.TYPE valueType = 4; +// .stream.TYPE valueType = 4; inline void RequestInfo::clear_valuetype() { _impl_.valuetype_ = 0; } -inline ::stream::RequestInfo_TYPE RequestInfo::valuetype() const { +inline ::stream::TYPE RequestInfo::valuetype() const { // @@protoc_insertion_point(field_get:stream.RequestInfo.valueType) return _internal_valuetype(); } -inline void RequestInfo::set_valuetype(::stream::RequestInfo_TYPE value) { +inline void RequestInfo::set_valuetype(::stream::TYPE value) { _internal_set_valuetype(value); // @@protoc_insertion_point(field_set:stream.RequestInfo.valueType) } -inline ::stream::RequestInfo_TYPE RequestInfo::_internal_valuetype() const { +inline ::stream::TYPE RequestInfo::_internal_valuetype() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::stream::RequestInfo_TYPE>(_impl_.valuetype_); + return static_cast<::stream::TYPE>(_impl_.valuetype_); } -inline void RequestInfo::_internal_set_valuetype(::stream::RequestInfo_TYPE value) { +inline void RequestInfo::_internal_set_valuetype(::stream::TYPE value) { PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); ; _impl_.valuetype_ = value; @@ -832,128 +1042,50 @@ inline void ResponseInfo::_internal_set_result(bool value) { _impl_.result_ = value; } -// bytes nameKey = 3; -inline void ResponseInfo::clear_namekey() { - _impl_.namekey_.ClearToEmpty(); +// repeated .stream.ParamInfo item = 3; +inline int ResponseInfo::_internal_item_size() const { + return _internal_item().size(); } -inline const std::string& ResponseInfo::namekey() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.nameKey) - return _internal_namekey(); +inline int ResponseInfo::item_size() const { + return _internal_item_size(); } -template -inline PROTOBUF_ALWAYS_INLINE void ResponseInfo::set_namekey(Arg_&& arg, - Args_... args) { +inline void ResponseInfo::clear_item() { + _internal_mutable_item()->Clear(); +} +inline ::stream::ParamInfo* ResponseInfo::mutable_item(int index) { + // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.item) + return _internal_mutable_item()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >* +ResponseInfo::mutable_item() { + // @@protoc_insertion_point(field_mutable_list:stream.ResponseInfo.item) PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.namekey_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.nameKey) + return _internal_mutable_item(); } -inline std::string* ResponseInfo::mutable_namekey() { - std::string* _s = _internal_mutable_namekey(); - // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.nameKey) - return _s; +inline const ::stream::ParamInfo& ResponseInfo::item(int index) const { + // @@protoc_insertion_point(field_get:stream.ResponseInfo.item) + return _internal_item().Get(index); } -inline const std::string& ResponseInfo::_internal_namekey() const { +inline ::stream::ParamInfo* ResponseInfo::add_item() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::stream::ParamInfo* _add = _internal_mutable_item()->Add(); + // @@protoc_insertion_point(field_add:stream.ResponseInfo.item) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField< ::stream::ParamInfo >& +ResponseInfo::item() const { + // @@protoc_insertion_point(field_list:stream.ResponseInfo.item) + return _internal_item(); +} +inline const ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>& +ResponseInfo::_internal_item() const { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.namekey_.Get(); + return _impl_.item_; } -inline void ResponseInfo::_internal_set_namekey(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.namekey_.Set(value, GetArenaForAllocation()); -} -inline std::string* ResponseInfo::_internal_mutable_namekey() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.namekey_.Mutable( GetArenaForAllocation()); -} -inline std::string* ResponseInfo::release_namekey() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:stream.ResponseInfo.nameKey) - return _impl_.namekey_.Release(); -} -inline void ResponseInfo::set_allocated_namekey(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.namekey_.SetAllocated(value, GetArenaForAllocation()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.namekey_.IsDefault()) { - _impl_.namekey_.Set("", GetArenaForAllocation()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:stream.ResponseInfo.nameKey) -} - -// bytes strValue = 4; -inline void ResponseInfo::clear_strvalue() { - _impl_.strvalue_.ClearToEmpty(); -} -inline const std::string& ResponseInfo::strvalue() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.strValue) - return _internal_strvalue(); -} -template -inline PROTOBUF_ALWAYS_INLINE void ResponseInfo::set_strvalue(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.strvalue_.SetBytes(static_cast(arg), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.strValue) -} -inline std::string* ResponseInfo::mutable_strvalue() { - std::string* _s = _internal_mutable_strvalue(); - // @@protoc_insertion_point(field_mutable:stream.ResponseInfo.strValue) - return _s; -} -inline const std::string& ResponseInfo::_internal_strvalue() const { +inline ::google::protobuf::RepeatedPtrField<::stream::ParamInfo>* +ResponseInfo::_internal_mutable_item() { PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.strvalue_.Get(); -} -inline void ResponseInfo::_internal_set_strvalue(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.strvalue_.Set(value, GetArenaForAllocation()); -} -inline std::string* ResponseInfo::_internal_mutable_strvalue() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.strvalue_.Mutable( GetArenaForAllocation()); -} -inline std::string* ResponseInfo::release_strvalue() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:stream.ResponseInfo.strValue) - return _impl_.strvalue_.Release(); -} -inline void ResponseInfo::set_allocated_strvalue(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.strvalue_.SetAllocated(value, GetArenaForAllocation()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.strvalue_.IsDefault()) { - _impl_.strvalue_.Set("", GetArenaForAllocation()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:stream.ResponseInfo.strValue) -} - -// .stream.ResponseInfo.TYPE valueType = 5; -inline void ResponseInfo::clear_valuetype() { - _impl_.valuetype_ = 0; -} -inline ::stream::ResponseInfo_TYPE ResponseInfo::valuetype() const { - // @@protoc_insertion_point(field_get:stream.ResponseInfo.valueType) - return _internal_valuetype(); -} -inline void ResponseInfo::set_valuetype(::stream::ResponseInfo_TYPE value) { - _internal_set_valuetype(value); - // @@protoc_insertion_point(field_set:stream.ResponseInfo.valueType) -} -inline ::stream::ResponseInfo_TYPE ResponseInfo::_internal_valuetype() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::stream::ResponseInfo_TYPE>(_impl_.valuetype_); -} -inline void ResponseInfo::_internal_set_valuetype(::stream::ResponseInfo_TYPE value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.valuetype_ = value; + return &_impl_.item_; } #ifdef __GNUC__ @@ -968,16 +1100,10 @@ namespace google { namespace protobuf { template <> -struct is_proto_enum<::stream::RequestInfo_TYPE> : std::true_type {}; +struct is_proto_enum<::stream::TYPE> : std::true_type {}; template <> -inline const EnumDescriptor* GetEnumDescriptor<::stream::RequestInfo_TYPE>() { - return ::stream::RequestInfo_TYPE_descriptor(); -} -template <> -struct is_proto_enum<::stream::ResponseInfo_TYPE> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::stream::ResponseInfo_TYPE>() { - return ::stream::ResponseInfo_TYPE_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor<::stream::TYPE>() { + return ::stream::TYPE_descriptor(); } } // namespace protobuf diff --git a/PrintS/protobuf/stream.proto b/PrintS/protobuf/stream.proto index 9627f36..0efa1bc 100644 --- a/PrintS/protobuf/stream.proto +++ b/PrintS/protobuf/stream.proto @@ -9,40 +9,34 @@ option java_package = "io.grpc.examples.stream"; option java_outer_classname = "StreamProto"; option objc_class_prefix = "ST"; +enum TYPE{ + iBOOL = 0; + iSHORT = 1; + iUSHORT = 2; + iINT = 3; + iUINT = 4; + iFLOAT = 5; + iSTRING = 6; +} + +message ParamInfo{ + bytes nameKey = 1; //参数key + bytes strValue = 2; //value + TYPE valueType = 3; //数据类型 +} + message RequestInfo { uint32 dataType = 1; //信息类型 bytes nameKey = 2; //参数key - bytes strValue = 3; //value - - enum TYPE{ - iBOOL = 0; - iSHORT = 1; - iUSHORT = 2; - iINT = 3; - iUINT = 4; - iFLOAT = 5; - iSTRING = 6; - } - TYPE valueType = 4; + bytes strValue = 3; //value值 + TYPE valueType = 4; //value数据类型 } message ResponseInfo { uint32 dataType = 1; //信息类型 - bool result = 2; - bytes nameKey = 3; //参数key - bytes strValue = 4; //value - - enum TYPE{ - iBOOL = 0; - iSHORT = 1; - iUSHORT = 2; - iINT = 3; - iUINT = 4; - iFLOAT = 5; - iSTRING = 6; - } - TYPE valueType = 5; //数据类型 + bool result = 2; //执行成功与否 + repeated ParamInfo item = 3; //参数值 }