[someip专题]vsomeip代码解析3

 代码下载,大家请参考 ,以下则直接说明每个文件,每个函数,作用,共同记录学习GitHub - COVESA/vsomeip: An implementation of Scalable service-Oriented MiddlewarE over IP

1someip基础知识

关于SOME/IP的理解_AgingMoon的博客-CSDN博客_someip

2.vsomeip 安装使用

[someip专题]vsomeip使用以及代码解析1_AgingMoon的博客-CSDN博客

3.hello world代码解析

[someip专题]vsomeip代码解析2_AgingMoon的博客-CSDN博客

4. application 解析

4.1 vsomeip application主要功能

主要功能包括

功能 说明
offer service 提供服务
stop offer service 停止提供服务
publish eventgroup 发布事件组
stop publish eventgroup 停止发布事件组
send request 发送请求
send response 发送响应
trigger event 事件驱动
update field 更新域
receive message 接收消息
subscribe eventgroup 订阅事件组
unsubscribe eventgroup 取消订阅事件组
request service 请求服务
release service 释放服务

 4.2 vsomeip application 静态结构

 以下针对application中,涉及到的函数进行说明

4.3 vsomeip runtime class

runtime class 接口声明在 interface/vsomeip/runtime.hpp 文件中

runtime 主要包含,vsomeip公共资源的管理,是一个单例类,是application类,创建实例化的入口,前面我们也提到 用runtime 去创建application。

    /**
     *
     * \brief 创建vsomeip application 对象.
     *
     *应用对象用于管理服务提供,和请求,以及事件订阅,应用对象的名称通过配置文件唯一识别, 
     *如果名字为空,则会从环境变量VSOMEIP_APPLICATION_NAME中获取
     *
     * \param _name Name of the application 
     *
     */
    virtual std::shared_ptr<application> create_application(
            const std::string &_name = "") = 0;
    /**
     *
     * \brief 构建一个空的 message 对象.
     *
     * \param _reliable 可靠性由TCP连接还是UDP连接决定
     *
     */
    virtual std::shared_ptr<message> create_message(
            bool _reliable = false) const = 0;
    /**
     *
     * \brief 构建空的 request message.
     *
     *消息内容和服务实例,有用户设定
     *
     */
    virtual std::shared_ptr<message> create_request(
            bool _reliable = false) const = 0;
    /*
     * \brief 从给定的请求消息 构建 empty response message 
     *
     */
    virtual std::shared_ptr<message> create_response(
            const std::shared_ptr<message> &_request) const = 0;
    /**
     *
     * \brief 创建空的 notification message.
     *
     * Note: Creating notification messages and sending them using
     * @ref application::send is possible but not the standard way of sending
     * notification with vsomeip. The standard way is calling
     * @ref application::offer_event and setting the value using the
     * @ref application::notify / @ref application::notify_one methods.
     *
     */
    virtual std::shared_ptr<message> c
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值