Descriptors for function interfaces

原创 2007年10月09日 11:55:00

下面的内容摘自Symbian S60 3rd Edition SDK,先把英文原版贴在这里,等时间充足的时候我再把它翻译出来。How to Use Descriptors之Descriptors for function interfaces《函数接口中描述符的使用》

Descriptors for function interfaces

Many interfaces which use or manipulate text strings or general binary data use descriptors to specify the interface. In conventional ‘C’ programming, interfaces are specified using a combination of char*, void* and length values. In Symbian OS, descriptors are always used.

There are four main cases:

  • Passing a constant string

    In ‘C’: StringRead(const char* aString);

    The length of the string is implied by the zero terminator; therefore, the function does not require the length to be explicitly specified.

    In Symbian OS: StringRead(const TDesC& aString);

    The descriptor can access the string and contains its length.

  • Passing a string which can be changed.

    In ‘C’: StringWrite(char* aString, int aMaxLength);

    The length of the passed string is implied by the zero terminator. aMaxLength indicates the maximum length to which the string may be extended.

    In Symbian OS: StringWrite(TDes& aString);

    The descriptor can access the string and contains its length and the maximum length to which the string may be extended.

  • Passing a buffer containing general binary data

    In ‘C’: BufferRead(const void* aBuffer, int aLength);

    Both the address and length of the buffer must be specified.

    In Symbian OS: BufferRead(const TDes8& aBuffer);

    The descriptor has access to the address of the buffer and contains the length of the data. The 8 bit variant is explicitly specified; the buffer is treated as byte data, regardless of the build variant.

  • Passing a buffer containing general binary data which can be changed.

    In ‘C’:BufferWrite(void* aBuffer, int& aLength, int aMaxLength);

    The address of the buffer, the current length of the data and the maximum length of the buffer are specified. The aLength parameter is specified as a reference to allow the function to indicate the length of the data on return.

    In Symbian OS: BufferRead(TDes8& aBuffer);

    The descriptor has access to the adddress of the buffer and contains the length of the data and the maximum length. The 8 bit variant is explicitly specified; the buffer is treated as byte data, regardless of the build variant.

Defining interfaces using the base descriptor classes allows callers to pass all appropriate derived descriptor types.

 

关于asyncio的ValueError: too many file descriptors in select()错误

最近写爬虫用asyncio+aiohttp的形式,代码如下: import aiohttp import asyncio headers = { "Upgrade-Insecure...
  • u013055678
  • u013055678
  • 2017-08-22 17:02:21
  • 1120

"maximum open file descriptors" is set to at least 65536

安装oracle或者其他oracle产品时候,最后检查项目提示问题, 请确保配置了合适的资源限制参数,资源限制配置参数文件为: /etc/security/limits.conf 注意,如果想让...
  • jc_benben
  • jc_benben
  • 2015-10-25 17:06:33
  • 759

Aggregating local descriptors into a compact image representation(阅读)

这一篇论文是有关图像检索的,解决在在规模图像的搜索问题(比如搜索准确率,效率,和图像特征表示的使用内存)。首先使用一种简单有效的方法,...
  • langb2014
  • langb2014
  • 2016-07-04 14:39:17
  • 1012

Windows下用Nginx+Tomcat配置集群负载均衡

Nginx是一款轻量级的web服务器/反向代理服务器,更详细的释义自己百度了。目前国内像新浪、网易等都在使用它。...
  • a443453087
  • a443453087
  • 2015-01-27 15:01:01
  • 9915

mvn assembly:single打包报错:Error reading assemblies: No assembly descriptors found.

maven-assembly-plugin 打包报错:Error reading assemblies: No assembly descriptors found.
  • znsqingfeng
  • znsqingfeng
  • 2016-05-03 09:34:49
  • 2748

A performance evaluation of local descriptors——局部描述子评估译文

A performance evaluation of local descriptors——局部描述子评估译文(1,2,...) 现有局部描述子的性能评估 Krystian Mikolajc...
  • u010141025
  • u010141025
  • 2014-01-02 11:03:17
  • 1497

ElasticSearch集群入门

一、下载与安装Elasticsearch 依赖 java,在安装 ES 之前首先要配好 java,这个默认我们的电 脑已经完成。 首先从 elasticsearch官网下载安装包,我们是 linux...
  • napoay
  • napoay
  • 2016-06-18 17:42:05
  • 10771

"Action Recognition with Trajectory-Pooled Deep-Convolutional Descriptors"阅读小结

1、摘要: 本论文提出一种新的视频表示方法,称作轨迹池化-深度卷积描述符(TDD),共享手工制作的特征和深度学习特征。优点是:(1) TDDs是自动学习,并且与这些手工制作的特征相比具有高区分度的性...
  • qq_29828623
  • qq_29828623
  • 2016-05-28 18:55:50
  • 1366

caffe->tensorflow模型出错:TypeError: Descriptors should not be created directly

File “/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor.py”, line 654, in new _...
  • qq_25737169
  • qq_25737169
  • 2017-09-01 15:04:00
  • 395

Could not read input channel file descriptors from parcel.

[Exception] Could not read input channel file descriptors from parcel. 1.RemoteView中添加的图片太大了,...
  • lucky_liuxiang
  • lucky_liuxiang
  • 2014-06-19 19:09:19
  • 3546
收藏助手
不良信息举报
您举报文章:Descriptors for function interfaces
举报原因:
原因补充:

(最多只允许输入30个字)