Protocol Buffer处理嵌套message
来源:互联网 发布:linux 修改路由metric 编辑:程序博客网 时间:2024/05/10 17:35
Protocol Buffer处理嵌套message
对于复杂结构(嵌套message)
set_allocated_xx
函数使用的必须是外部分配(堆)的变量,不能传递stack变量,否则会产生delete
stack错误;传递堆变量后该变量由protobuf管理- 一般使用
mutable_xx
函数,该函数内部开辟堆内存空间返回一个指针,通过该指针对message数据进行操作。
代码:
sm3::m_login_toc msg_toc;
sm3::m_permission *per = msg_toc.mutable_per();
之后调用set或add之类的方法就OK了
0 0
- Protocol Buffer处理嵌套message
- C++ Class Mapped Google Protocol Buffer Message
- Google protocol buffer(4)—Google protocol buffer + socket实现message的连续传输
- protocol buffer
- protocol buffer
- Protocol Buffer
- protocol Buffer
- protocol buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- Protocol Buffer
- 【字符串系列】柔性字符串匹配代码实现
- 【计蒜客系列】挑战难题374:统计个数(课后)
- iOS开发的一些奇谲巧技
- Python之数据类型 一
- java学习9.21
- Protocol Buffer处理嵌套message
- linux驱动之PCI总线
- C++设计模式——观察者模式
- html5+exif.js+canvas实现手机端照片上传预览、压缩、旋转功能
- linux常用命令(50):tftp 命令
- HDU 1237(简单计算器)栈的应用-表达式求值
- Linux下目录的合并以及文件的覆盖案例
- MySQL数据库MyISAM和InnoDB存储引擎的比较
- 【J2EE】企业级项目开发总结--EJB篇