使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
gpg::ICrossAppEndpointDiscoveryListener
这是一个抽象类。
#include <i_cross_app_endpoint_discovery_listener.h>
定义一个接口,用于传送与跨应用远程端点发现相关的事件。
摘要
公共函数
OnCrossAppEndpointFound
virtual void OnCrossAppEndpointFound(
int64_t client_id,
const EndpointDetails & endpoint_details,
const std::vector< AppIdentifier > & app_identifiers
)=0
在找到远程端点时调用;对于每个发现的端点,都会调用一次。
请注意,此方法可能会在短时间内反复调用;您可能需要延迟对界面的更新,以便在调用此方法后的一小段时间内反映新端点。
OnCrossAppEndpointLost
virtual void OnCrossAppEndpointLost(
int64_t client_id,
const std::string & instance_id
)=0
在远程端点无法再被发现时调用;仅使用之前传递给 OnEndpointFound
的 ID 调用。
请注意,此方法可能会在短时间内反复调用;您可能需要延迟对界面的更新,以反映在调用此方法后端点消失了一小段时间。
~ICrossAppEndpointDiscoveryListener
virtual ~ICrossAppEndpointDiscoveryListener()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# gpg::ICrossAppEndpointDiscoveryListener Class Reference\n\ngpg::ICrossAppEndpointDiscoveryListener\n=======================================\n\n**This is an abstract class.** \n\n`#include \u003ci_cross_app_endpoint_discovery_listener.h\u003e`\n\nDefines an interface which can be delivered events relating to cross-app remote endpoint discovery.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~ICrossAppEndpointDiscoveryListener](#classgpg_1_1_i_cross_app_endpoint_discovery_listener_1a2dadf1440f5e15be043e76b165e409fc)`()` ||\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OnCrossAppEndpointFound](#classgpg_1_1_i_cross_app_endpoint_discovery_listener_1abf3c474e6d4ee0eae204655889fd4953)`(int64_t client_id, const `[EndpointDetails](/games/services/cpp/api/struct/gpg/endpoint-details#structgpg_1_1_endpoint_details)` & endpoint_details, const std::vector\u003c `[AppIdentifier](/games/services/cpp/api/struct/gpg/app-identifier#structgpg_1_1_app_identifier)` \u003e & app_identifiers)=0` | `virtual void` Invoked when a remote endpoint is found; will be invoked once for each endpoint discovered. |\n| [OnCrossAppEndpointLost](#classgpg_1_1_i_cross_app_endpoint_discovery_listener_1ae6c1bd2a5ec6fc9fd6d4e1972f86ed58)`(int64_t client_id, const std::string & instance_id)=0` | `virtual void` Invoked when a remote endpoint is no longer discoverable; will only be called with IDs that previously were passed to `OnEndpointFound`. |\n\nPublic functions\n----------------\n\n### OnCrossAppEndpointFound\n\n```c++\nvirtual void OnCrossAppEndpointFound(\n int64_t client_id,\n const EndpointDetails & endpoint_details,\n const std::vector\u003c AppIdentifier \u003e & app_identifiers\n)=0\n``` \nInvoked when a remote endpoint is found; will be invoked once for each endpoint discovered.\n\nNote that this method may be invoked repeatedly in short succession; you may wish to delay the update to the UI to reflect the new endpoint for some short time period after the method is invoked. \n\n### OnCrossAppEndpointLost\n\n```c++\nvirtual void OnCrossAppEndpointLost(\n int64_t client_id,\n const std::string & instance_id\n)=0\n``` \nInvoked when a remote endpoint is no longer discoverable; will only be called with IDs that previously were passed to `OnEndpointFound`.\n\nNote that this method may be invoked repeatedly in short succession; you may with to delay the update to the UI to reflect the endpoint being gone for some short time period after the method is invoked. \n\n### \\~ICrossAppEndpointDiscoveryListener\n\n```c++\nvirtual ~ICrossAppEndpointDiscoveryListener()\n```"]]