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 Nearby Connections. Les rappels non définis explicitement n'ont aucun effet.
Constructeurs et destructeurs |
|
---|---|
EndpointDiscoveryListenerHelper()
|
|
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
Construit un EndpointDiscoveryListenerHelper en passant d'un
shared_ptr à un EndpointDiscoveryListenerHelperImpl . |
Types publics |
|
---|---|
OnEndpointFoundCallback
|
typedefstd::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback est appelé lorsqu'un point de terminaison distant est trouvé. |
OnEndpointLostCallback
|
typedefstd::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éfinit le OnEndpointFoundCallback.
|
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
|
Définit le 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 trouvé.
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écouvert.
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 en passant d'un shared_ptr
à un EndpointDiscoveryListenerHelperImpl
.
Destiné à un usage interne par l'API.
SetOnEndpointFoundCallback
EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback( OnEndpointFoundCallback callback )
Définit le OnEndpointFoundCallback.
SetOnEndpointLostCallback
EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback( OnEndpointLostCallback callback )
Définit le OnEndpointLostCallback.