gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

Definisce un helper che può essere utilizzato per fornire callback IEndpointDiscoveryListener all'SDK senza definire l'interfaccia IEndpointDiscoveryListener completa.

Riepilogo

I callback configurati su questo oggetto verranno richiamati come descritto nell'API Connections nelle vicinanze. I callback non impostati esplicitamente non avranno alcun effetto.

Costruttori e distruttori

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
Crea un EndpointDiscoveryListenerHelper da shared_ptr a EndpointDiscoveryListenerHelperImpl.

Tipi pubblici

OnEndpointFoundCallback typedef
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback viene chiamato quando viene rilevato un endpoint remoto.
OnEndpointLostCallback typedef
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)>
OnEndpointLostCallback viene chiamato quando un endpoint remoto non è più rilevabile.

Funzioni pubbliche

SetOnEndpointFoundCallback(OnEndpointFoundCallback callback)
Impostare il valore OnEndpointFoundCallback.
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
Impostare OnEndpointLostCallback.

Tipi pubblici

OnEndpointFoundCallback

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

OnEndpointFoundCallback viene chiamato quando viene rilevato un endpoint remoto.

client_id è l'ID dell'istanza NearbyConnections che ha rilevato l'endpoint. endpoint_details contiene i dettagli dell'endpoint remoto rilevato.

OnEndpointLostCallback

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

OnEndpointLostCallback viene chiamato quando un endpoint remoto non è più rilevabile.

Funzioni pubbliche

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper()

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper(
  std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl
)

Crea un EndpointDiscoveryListenerHelper da shared_ptr a EndpointDiscoveryListenerHelperImpl.

Destinato all'uso interno da parte dell'API.

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

Impostare il valore OnEndpointFoundCallback.

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

Impostare OnEndpointLostCallback.