本文整理汇总了C++中protobuf_c_message_get_packed_size函数的典型用法代码示例。如果您正苦于以下问题:C++ protobuf_c_message_get_packed_size函数的具体用法?C++ protobuf_c_message_get_packed_size怎么用?C++ protobuf_c_message_get_packed_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了protobuf_c_message_get_packed_size函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TZIEncodeProtobuf
tz_return_t TZIEncodeProtobuf(tzi_encode_buffer_t *tz_buf,
const ProtobufCMessage *pb_msg)
{
void *pb_packed;
uint32_t pb_packed_len;
uint32_t pb_packed_len2;
if(TZIDecodeGetError(tz_buf)) {
goto out;
}
pb_packed_len = protobuf_c_message_get_packed_size(pb_msg);
pb_packed = TZIEncodeArraySpace(tz_buf, pb_packed_len);
if(!pb_packed) {
assert(TZIDecodeGetError(tz_buf) != 0);
return TZIDecodeGetError(tz_buf);
}
pb_packed_len2 = protobuf_c_message_pack(pb_msg, pb_packed);
if(pb_packed_len2 != pb_packed_len) {
/* add custom error instead? */
tz_buf->uiRetVal = TZ_ERROR_ENCODE_FORMAT;
goto out;
}
out:
return TZIDecodeGetError(tz_buf);
}
示例2: protobuf_c_message_get_field_desc_count_and_offset
size_t
KeySpecHelper::get_binpath(const uint8_t **bdata)
{
size_t ret_len = 0;
*bdata = nullptr;
const ProtobufCFieldDescriptor *bin_fd = nullptr;
const ProtobufCFieldDescriptor *dom_fd = nullptr;
protobuf_c_boolean is_dptr = false;
void *field_ptr = nullptr;
size_t offset = 0;
size_t count = protobuf_c_message_get_field_desc_count_and_offset(&keyspec_->base,
RW_SCHEMA_TAG_KEYSPEC_BINPATH, &bin_fd, &field_ptr, &offset, &is_dptr);
RW_ASSERT(bin_fd);
RW_ASSERT(bin_fd->type == PROTOBUF_C_TYPE_BYTES);
RW_ASSERT(bin_fd->label != PROTOBUF_C_LABEL_REPEATED);
if (!count) {
size_t dcount = protobuf_c_message_get_field_desc_count_and_offset(&keyspec_->base,
RW_SCHEMA_TAG_KEYSPEC_DOMPATH, &dom_fd, &field_ptr, &offset, &is_dptr);
if (!dcount) {
return ret_len;
}
RW_ASSERT(dom_fd->type == PROTOBUF_C_TYPE_MESSAGE);
RW_ASSERT(dom_fd->label != PROTOBUF_C_LABEL_REPEATED);
size_t dsize = protobuf_c_message_get_packed_size(nullptr, (ProtobufCMessage *)field_ptr);
RW_ASSERT(dsize);
ProtobufCFlatBinaryData *bd = (ProtobufCFlatBinaryData *)malloc(sizeof(ProtobufCFlatBinaryData)+dsize);
bd->len = dsize;
RW_ASSERT(protobuf_c_message_pack(nullptr, (ProtobufCMessage*)field_ptr, bd->data) == dsize);
*bdata = bd->data;
ret_len = bd->len;
binpath_.reset(bd);
} else {
if (bin_fd->rw_flags & RW_PROTOBUF_FOPT_INLINE) {
*bdata = ((ProtobufCFlatBinaryData *)field_ptr)->data;
ret_len = ((ProtobufCFlatBinaryData *)field_ptr)->len;
} else {
*bdata = ((ProtobufCBinaryData *)field_ptr)->data;
ret_len = ((ProtobufCBinaryData *)field_ptr)->len;
}
}
return ret_len;
}
示例3: PROTOBUF_C_ASSERT
size_t db_blob_role_info__get_packed_size
(const DbBlobRoleInfo *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &db_blob_role_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例4: assert
size_t query_by_id_request__get_packed_size
(const QueryByIdRequest *message)
{
assert(message->base.descriptor == &query_by_id_request__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例5: PROTOBUF_C_ASSERT
size_t req_auth__get_packed_size
(const ReqAuth *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &req_auth__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例6: PROTOBUF_C_ASSERT
size_t cfg__npcs__get_packed_size
(const CFGNPCS *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &cfg__npcs__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例7: PROTOBUF_C_ASSERT
size_t exnode3__view__get_packed_size
(const Exnode3__View *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &exnode3__view__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例8: PROTOBUF_C_ASSERT
size_t log_entry__get_packed_size
(const LogEntry *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &log_entry__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例9: assert
size_t ccx_sub_entry_message__get_packed_size
(const CcxSubEntryMessage *message)
{
assert(message->base.descriptor == &ccx_sub_entry_message__descriptor);
return protobuf_c_message_get_packed_size((const ProtobufCMessage*)(message));
}
示例10: PROTOBUF_C_ASSERT
size_t pinba__request__get_packed_size
(const Pinba__Request *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &pinba__request__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例11: PROTOBUF_C_ASSERT
size_t hadoop__yarn__localizer_status_proto__get_packed_size
(const Hadoop__Yarn__LocalizerStatusProto *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &hadoop__yarn__localizer_status_proto__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
开发者ID:leftnoteasy-tmp,项目名称:d41d8cd98f00b204e9800998ecf8427e,代码行数:6,代码来源:yarn_server_nodemanager_service_protos.pb-c.c
示例12: PROTOBUF_C_ASSERT
size_t osmpbf__blob_header__get_packed_size
(const OSMPBF__BlobHeader *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &osmpbf__blob_header__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例13: PROTOBUF_C_ASSERT
size_t kvstr__get_packed_size
(const KVStr *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &kvstr__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例14: assert
size_t stats_request__get_packed_size
(const StatsRequest *message)
{
assert(message->base.descriptor == &stats_request__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
示例15: PROTOBUF_C_ASSERT
size_t response__get_packed_size
(const RESPONSE *message)
{
PROTOBUF_C_ASSERT (message->base.descriptor == &response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}