当前位置: 首页>>代码示例>>C++>>正文


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怎么用?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);
}
开发者ID:anbangr,项目名称:trustvisor-dev,代码行数:30,代码来源:tze-pb-marshal.c

示例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;
}
开发者ID:RIFTIO,项目名称:RIFT.ware,代码行数:57,代码来源:rw_ks_helper.cpp

示例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));
}
开发者ID:a1406,项目名称:txgg,代码行数:6,代码来源:db_role_info.pb-c.c

示例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));
}
开发者ID:alexyarikov,项目名称:ZMQClientServer,代码行数:6,代码来源:query_by_id_req.pb-c.c

示例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));
}
开发者ID:House-Lee,项目名称:PeerAutoDiscovery,代码行数:6,代码来源:common_msg.pb-c.c

示例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));
}
开发者ID:a1406,项目名称:txgg,代码行数:6,代码来源:config_NPC.pb-c.c

示例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));
}
开发者ID:PerilousApricot,项目名称:lstore-lio,代码行数:6,代码来源:exnode3.pb-c.c

示例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));
}
开发者ID:LLParse,项目名称:fuse_kafka,代码行数:6,代码来源:log.pb-c.c

示例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));
}
开发者ID:17eparker,项目名称:ccextractor,代码行数:6,代码来源:ccx_sub_entry_message.pb-c.c

示例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));
}
开发者ID:Daniel15,项目名称:dotdeb-nginx,代码行数:6,代码来源:pinba.pb-c.c

示例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));
}
开发者ID:FiskerLars,项目名称:libosmaccess,代码行数:6,代码来源:fileformat.pb-c.c

示例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));
}
开发者ID:kwangiit,项目名称:SLURMPP,代码行数:6,代码来源:kvstr.pb-c.c

示例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));
}
开发者ID:zhiyuan2007,项目名称:logstats,代码行数:6,代码来源:statsmessage.pb-c.c

示例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));
}
开发者ID:bernardo5,项目名称:psis,代码行数:6,代码来源:messages.pb-c.c


注:本文中的protobuf_c_message_get_packed_size函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。