gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

完全な IEndpointDiscoveryListener インターフェースを定義せずに IEndpointDiscoveryListener コールバックを SDK に提供するために使用できるヘルパーを定義します。

概要

このオブジェクトに設定されているコールバックは、Nearby Connections API の説明に沿って呼び出されます。明示的に設定されていないコールバックは、何も実行しません。

コンストラクタとデストラクタ

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
shared_ptr から EndpointDiscoveryListenerHelperImpl への EndpointDiscoveryListenerHelper を構築します。

公開タイプ

OnEndpointFoundCallback typedef
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback は、リモート エンドポイントが検出されると呼び出されます。
OnEndpointLostCallback typedef
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)>
OnEndpointLostCallback は、リモート エンドポイントを検出できなくなると呼び出されます。

パブリック関数

SetOnEndpointFoundCallback(OnEndpointFoundCallback callback)
OnEndpointFoundCallback を設定します。
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
OnEndpointLostCallback を設定します。

公開タイプ

OnEndpointFoundCallback

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

OnEndpointFoundCallback は、リモート エンドポイントが検出されると呼び出されます。

client_id は、エンドポイントを検出した NearbyConnections インスタンスの ID です。endpoint_details には、検出されたリモート エンドポイントの詳細が含まれます。

OnEndpointLostCallback

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

OnEndpointLostCallback は、リモート エンドポイントを検出できなくなると呼び出されます。

パブリック関数

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper()

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper(
  std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl
)

shared_ptr から EndpointDiscoveryListenerHelperImpl への EndpointDiscoveryListenerHelper を構築します。

API の内部で使用することを目的としています。

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

OnEndpointFoundCallback を設定します。

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

OnEndpointLostCallback を設定します。