摘要:
【protobuf's custom-options】 protobuf可以设置属性,就像__attribute__可以给函数设置属性一样,protobuf更牛的是可以设置自定义属性。实际就是属性对象,用于描述一个属性。 protobuf可设置的属性如下: 需按如下方式使用: 代码中需要按如下方式来获取值。 参考:https://developers.google.com/protocol-buffers/docs/proto#options 阅读全文
posted @ 2013-11-07 23:02
Tekkaman
阅读(960)
评论(0)
推荐(0)
摘要:
【protobuf's extension】 extension允许第三方扩展协议,开发方需要像下面这样定义: 扩展方需要像下面这样扩展: 使用的时候必须用SetExtension方法: 参考:https://developers.google.com/protocol-buffers/docs/proto#extensions 阅读全文
posted @ 2013-11-07 22:46
Tekkaman
阅读(1026)
评论(0)
推荐(0)
摘要:
[the difference between fopen&open] fopen是C标准API,open是linux系统调用,层次上fopen基于open,在其之上。fopen有缓存,open无缓存,对于顺序读取,fopen更高效。 参考:http://www.cnblogs.com/joeblackzqq/archive/2011/04/11/2013010.html 阅读全文
posted @ 2013-11-07 18:48
Tekkaman
阅读(243)
评论(0)
推荐(0)
摘要:
[why inline functions must be put in header files?] 编译中有2个过程:compile、link。先进行compile,compile中把源代码编译成目标代码(.obj),然后是link,把目标代码(obj)中的外部符号替换为真实的地址。 inline函数的作用是减少函数调用而直接使用函数内部内容,显示是发生在compile阶段。所以如果把inline函数放在cc文件中,则compile过程中无法实现inline效果,连接器将给出 “unresolved external” 。 事实上,inline一个函数,也意味着给该函数加上了stat... 阅读全文
posted @ 2013-11-07 18:41
Tekkaman
阅读(380)
评论(0)
推荐(0)
摘要:
[sed] sed 用于多文本行处理,使用规则与vi中的类似,vi适用于单一文本的处理,sed适用于多文本。 参考:http://man.lupaworld.com/content/manage/ringkee/sed.htm 阅读全文
posted @ 2013-11-07 11:23
Tekkaman
阅读(230)
评论(0)
推荐(0)
浙公网安备 33010602011771号