Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
gpg::EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
Definiert einen Hilfsprogramm, mit dem IEndpointDiscoveryListener-Rückrufe an das SDK bereitgestellt werden können, ohne die vollständige IEndpointDiscoveryListener-Schnittstelle zu definieren.
Zusammenfassung
Für dieses Objekt konfigurierte Callbacks werden wie in der Nearby Connections API beschrieben aufgerufen. Callbacks, die nicht explizit festgelegt sind, bewirken nichts.
Öffentliche Typen
|
OnEndpointFoundCallback
|
typedef.
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback wird aufgerufen, wenn ein Remote-Endpunkt gefunden wird.
|
OnEndpointLostCallback
|
typedef.
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)>
OnEndpointLostCallback wird aufgerufen, wenn ein Remote-Endpunkt nicht mehr sichtbar ist.
|
Öffentliche Typen
OnEndpointFoundCallback
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)> OnEndpointFoundCallback
OnEndpointFoundCallback
wird aufgerufen, wenn ein Remote-Endpunkt gefunden wird.
client_id
ist die ID der NearbyConnections-Instanz, die den Endpunkt erkannt hat. endpoint_details
enthält die Details zum erkannten Remote-Endpunkt.
OnEndpointLostCallback
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)> OnEndpointLostCallback
OnEndpointLostCallback
wird aufgerufen, wenn ein Remote-Endpunkt nicht mehr sichtbar ist.
Öffentliche Funktionen
EndpointDiscoveryListenerHelper
EndpointDiscoveryListenerHelper()
Alle Inhalte und Codebeispiele auf dieser Seite unterliegen den Lizenzen wie im Abschnitt Inhaltslizenz beschrieben. Java und OpenJDK sind Marken oder eingetragene Marken von Oracle und/oder seinen Tochtergesellschaften.
Zuletzt aktualisiert: 2025-07-27 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-27 (UTC)."],[],[],null,["# gpg::EndpointDiscoveryListenerHelper Class Reference\n\ngpg::EndpointDiscoveryListenerHelper\n====================================\n\n`#include \u003cendpoint_discovery_listener_helper.h\u003e`\n\nDefines a helper which can be used to provide [IEndpointDiscoveryListener](/games/services/cpp/api/class/gpg/i-endpoint-discovery-listener#classgpg_1_1_i_endpoint_discovery_listener) callbacks to the SDK without defining the full [IEndpointDiscoveryListener](/games/services/cpp/api/class/gpg/i-endpoint-discovery-listener#classgpg_1_1_i_endpoint_discovery_listener) interface.\n\nSummary\n-------\n\nCallbacks configured on this object will be invoked as described in the nearby connections API. Callbacks not explicitly set will do nothing.\n\n| ### Constructors and Destructors ||\n|---|---|\n| [EndpointDiscoveryListenerHelper](#classgpg_1_1_endpoint_discovery_listener_helper_1ad33271ad25ee20072d78a2eeda900209)`()` ||\n| [EndpointDiscoveryListenerHelper](#classgpg_1_1_endpoint_discovery_listener_helper_1a575bde82a9754f7a37540f516431ac31)`(std::shared_ptr\u003c `[EndpointDiscoveryListenerHelperImpl](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper_1a11c2430f8609135c8c5ae7ad84df9a4e)` \u003e impl)` Constructs a [EndpointDiscoveryListenerHelper](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper) from a `shared_ptr` to a `EndpointDiscoveryListenerHelperImpl`. ||\n\n| ### Public types ||\n|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OnEndpointFoundCallback](#classgpg_1_1_endpoint_discovery_listener_helper_1a2db162a39aeb28dcf620a9a7f2ebf55e) | typedef `std::function\u003c void(int64_t client_id, const `[EndpointDetails](/games/services/cpp/api/struct/gpg/endpoint-details#structgpg_1_1_endpoint_details)` &endpoint_details)\u003e` `OnEndpointFoundCallback` is called when a remote endpoint is found. |\n| [OnEndpointLostCallback](#classgpg_1_1_endpoint_discovery_listener_helper_1a74269018f38766d3164b66df7dac0000) | typedef `std::function\u003c void(int64_t client_id, const std::string &remote_endpoint_id)\u003e` `OnEndpointLostCallback` is called when a remote endpoint is no longer discoverable. |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SetOnEndpointFoundCallback](#classgpg_1_1_endpoint_discovery_listener_helper_1ac3228d952cf2f7152f4b5e78407885da)`(`[OnEndpointFoundCallback](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper_1a2db162a39aeb28dcf620a9a7f2ebf55e)` callback)` | [EndpointDiscoveryListenerHelper](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper)` &` Set the OnEndpointFoundCallback. |\n| [SetOnEndpointLostCallback](#classgpg_1_1_endpoint_discovery_listener_helper_1a40e1bc52ca32cb2dcab6808a7050b0d1)`(`[OnEndpointLostCallback](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper_1a74269018f38766d3164b66df7dac0000)` callback)` | [EndpointDiscoveryListenerHelper](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper)` &` Set the OnEndpointLostCallback. |\n\nPublic types\n------------\n\n### OnEndpointFoundCallback\n\n```c++\nstd::function\u003c void(int64_t client_id, const EndpointDetails &endpoint_details)\u003e OnEndpointFoundCallback\n``` \n`OnEndpointFoundCallback` is called when a remote endpoint is found.\n\n`client_id` is the ID of the [NearbyConnections](/games/services/cpp/api/class/gpg/nearby-connections#classgpg_1_1_nearby_connections) instance that discovered the endpoint. `endpoint_details` contains the details of the discovered remote endpoint. \n\n### OnEndpointLostCallback\n\n```c++\nstd::function\u003c void(int64_t client_id, const std::string &remote_endpoint_id)\u003e OnEndpointLostCallback\n``` \n`OnEndpointLostCallback` is called when a remote endpoint is no longer discoverable.\n\nPublic functions\n----------------\n\n### EndpointDiscoveryListenerHelper\n\n```c++\n EndpointDiscoveryListenerHelper()\n``` \n\n### EndpointDiscoveryListenerHelper\n\n```c++\n EndpointDiscoveryListenerHelper(\n std::shared_ptr\u003c EndpointDiscoveryListenerHelperImpl \u003e impl\n)\n``` \nConstructs a [EndpointDiscoveryListenerHelper](/games/services/cpp/api/class/gpg/endpoint-discovery-listener-helper#classgpg_1_1_endpoint_discovery_listener_helper) from a `shared_ptr` to a `EndpointDiscoveryListenerHelperImpl`.\n\nIntended for internal use by the API. \n\n### SetOnEndpointFoundCallback\n\n```c++\nEndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(\n OnEndpointFoundCallback callback\n)\n``` \nSet the OnEndpointFoundCallback. \n\n### SetOnEndpointLostCallback\n\n```c++\nEndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(\n OnEndpointLostCallback callback\n)\n``` \nSet the OnEndpointLostCallback."]]