设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

Protocol Buffers 2.6.0发布

2014-9-28 16:18| 发布者: joejoe0332| 查看: 1686| 评论: 0|原作者: oschina|来自: oschina

摘要:   Protobuf 2.6.0 发布,此版本现已提供下载,更新内容如下:常规更新添加 oneofs(unions) 功能。Fields in the same oneof will sharememory and at most one field can be set at the same time. Use theoneof k ...

  Protobuf 2.6.0 发布,此版本现已提供下载,更新内容如下:


常规更新

  • 添加 oneofs(unions) 功能。Fields in the same oneof will share
    memory and at most one field can be set at the same time. Use the
    oneof keyword to define a oneof like:

    message SampleMessage {
      oneof test_oneof {
        string name = 4;
        YourMessage sub_message = 9;
      }
    }
  • Files, services, enums, messages, methods and enum values can be marked
    as deprecated now.

  • 解析 Java 和 C++ 文本格式 protos 时, 添加对 list values 的支持,包括 lists of messages

    For example:  foo: [1, 2, 3]


C++

  • Enhanced customization on TestFormat printing.

  • Added SwapFields() in reflection API to swap a subset of fields.
    Added SetAllocatedMessage() in reflection API.

  • Repeated primitive extensions are now packable. The
    [packed=true] option only affects serializers. Therefore, it is
    possible to switch a repeated extension field to packed format
    without breaking backwards-compatibility.

  • Various speed optimizations.


Java

  • writeTo() method in ByteString can now write a substring to an
    output stream. Added endWith() method for ByteString.

  • ByteString and ByteBuffer are now supported in CodedInputStream
    and CodedOutputStream.

  • java_generate_equals_and_hash can now be used with the LITE_RUNTIME.


Python

  • 新的 C++-backed 扩展模块 (aka "cpp api v2") 替代了旧版的 ("cpp api v1"),比纯 Python 代码更快,解决了许多 bug,建议所有使用纯 Python 的用户都升级!

  • Descriptors 现在包括 enum_types_by_name 和 extension_types_by_name dict
    属性

  • 支持 Python 3.

Protocol Buffers (ProtocolBuffer/ protobuf )是Google公司开发的一种数据描述语言,类似于XML能够将结构化数据序列化,可用于数据存储、通信协议等方面。现阶段支持C++、JAVA、Python等三种编程语言。

为什么不只用XML?同XML相比,Protocol buffers在序列化结构化数据方面有许多优点(google官方提出):

  • 更简单

  • 数据描述文件只需原来的1/10至1/3

  • 解析速度是原来的20倍至100倍

  • 减少了二义性

  • 生成了更容易在编程中使用的数据访问类

google大概是今天(08年7月8号)将其作为开源项目对外公布,说是后续还要开源的项目有不少都会用到Protocol Buffers。


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部