当前位置:网站首页>OpenHarmony模块二interfaces下头文件解析(8)
OpenHarmony模块二interfaces下头文件解析(8)
2022-07-15 17:14:00 【爱摸鱼的伪程序猿】
distributedschedule_samgr_lite/interfaces/kits/registry/registry.h
该文件提供了用于远程服务注册和发现的基本API,提供的API包括客户端代码的工厂注册功能,当存在自定义客户端对象时,将使用此文件。
该宏定义指示自定义客户端代理的创建者,为远程服务API创建本地客户端代理。
当需要以调用本地API的方式调用远程API时,需实现此宏以将序列化数据封装到代理中。
创建代理对象时,系统会自动调用此宏。
typedef void *(*Creator)(const char *service, const char *feature, uint32 size);
//service指示指向函数所属服务名称的指针。
//feature表示指向函数所属功能的名称的指针。
//size指示创建客户端代理时要添加的头的大小。所需的内存容量是头部大小加上对象大小。
//void*返回应用的内存容量并初始化客户端代理的内存。
该宏指示自定义客户端代理的销毁程序,将销毁远程服务API的本地客户端代理。当需要以调用本地API的方式调用远程API,需实现此宏以将序列化数据封装到代理中。
销毁代理对象时,系统会自动调用此宏。
typedef void (*Destroyer)(const char *service, const char *feature, void *iproxy);
//service指示指向函数所属服务名称的指针
//feature表示指向函数所属功能的名称的指针。
//iproxy表示指向<b>创建者应用的内存起始地址的指针。
该函数主要提供向Samgr注册客户端代理对象的方法。
在系统初始化期间,使用远程代理的模块会根据需要调用该函数。
int SAMGR_RegisterFactory(const char *service, const char *feature, Creator creator, Destroyer destroyer);
//service指示指向客户端代理的服务名称的指针。
//feature表示指向客户端代理的功能名称的指针。
//creator表示客户端代理的<b>creator</b>功能。
//destroyer表示客户端代理的<b>destroyer</b>功能
//如果注册成功,则返回EC_SUCCESS;如果注册失败,则返回其他错误代码。
边栏推荐
- Asymmetric encryption RSA and symmetric encryption AES project application
- The characteristics and underlying principles of synchronized, as well as the state and expansion and upgrading process of locks
- COMS技术
- Is there a limit on the length of string? How much is it?
- Basic usage of flask
- 单链链表的创建
- php 生成excel表的2种方法
- Illegal profits exceed one million, and new outlets in the industry are being cracked and eroded
- 初识OpenHarmony三大模块
- 用命令行登录并操作数据库
猜你喜欢

非法获利超百万,行业新风口正被破解侵蚀

Processing and analysis of yolov3 training data

TCP three handshakes and four waves diagram

If you don't want to step on those holes in SaaS, you must first understand the "SaaS architecture"
![Centernet (objects as points) [based on tf.slim]](/img/57/9906d367938a6698dc02e026eb61b8.png)
Centernet (objects as points) [based on tf.slim]

MySQL autoincrement, index, foreign key, other operations

用命令行登录并操作数据库

Illegal profits exceed one million, and new outlets in the industry are being cracked and eroded

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the

“智慧工厂”上线,破局传统工厂数字化转型
随机推荐
前六章补充案例和知识点(一)
MySQL MySQL Foundation
毫米波雷达学习(五)——角度估计
7. MySQL -- basic syntax (III) DCL
云上数字创新,如何塑造一座城市的幸福感?
Thumbnail image processing class library
C 语言入门(六)
Processing and analysis of yolov3 training data
When the decimal places are reserved, there may be a simple solution without rounding
Cron表达式使用
The regular expression retains [content within the matching range], and then replaces [content outside the matching range]
MySQL trigger
Design and implementation of fingertip Roulette Games (uniapp implements wechat applet)
利用chardet检测网页编码
mysql中 decimal(10,2)格式的通过stream 方式写到 kafka 变成 stri
C语言:使用宏重定义printf,打印【debug调试信息】
RuntimeWarning: overflow encountered in long_ scalars h = 12.0 / (totaln * (totaln + 1)) * ssbn - 3
ITSM确保IT服务台敏捷性的5大实践
CSDN中Markdown设置表格列宽度
非法获利超百万,行业新风口正被破解侵蚀