gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

Définit un assistant qui peut être utilisé pour fournir des rappels IEndpointDiscoveryListener au SDK sans définir l'interface IEndpointDiscoveryListener complète.

Résumé

Les rappels configurés sur cet objet seront appelés comme décrit dans l'API des connexions à proximité. Les rappels non définis explicitement n'auront aucun effet.

Constructeurs et destructeurs

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
Construit un EndpointDiscoveryListenerHelper depuis un shared_ptr vers un EndpointDiscoveryListenerHelperImpl.

Types publics

OnEndpointFoundCallback typedef
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback est appelé lorsqu'un point de terminaison distant est détecté.
OnEndpointLostCallback typedef
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)>
OnEndpointLostCallback est appelé lorsqu'un point de terminaison distant n'est plus visible.

Fonctions publiques

SetOnEndpointFoundCallback(OnEndpointFoundCallback callback)
Définissez le rappel OnEndpointFoundCallback.
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
Définissez le rappel OnEndpointLostCallback.

Types publics

OnEndpointFoundCallback

std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)> OnEndpointFoundCallback

OnEndpointFoundCallback est appelé lorsqu'un point de terminaison distant est détecté.

client_id est l'ID de l'instance NearbyConnections qui a détecté le point de terminaison. endpoint_details contient les détails du point de terminaison distant détecté.

OnEndpointLostCallback

std::function< void(int64_t client_id, const std::string &remote_endpoint_id)> OnEndpointLostCallback

OnEndpointLostCallback est appelé lorsqu'un point de terminaison distant n'est plus visible.

Fonctions publiques

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper()

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper(
  std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl
)

Construit un EndpointDiscoveryListenerHelper depuis un shared_ptr vers un EndpointDiscoveryListenerHelperImpl.

Destiné à un usage interne par l'API.

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

Définissez le rappel OnEndpointFoundCallback.

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

Définissez le rappel OnEndpointLostCallback.