gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

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

概要

このオブジェクトに設定されているコールバックが、Nearby connections API の記述に従って呼び出されます。明示的に設定されていないコールバックでは、何も起こりません。

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

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
shared_ptr から EndpointDiscoveryListenerHelperImplEndpointDiscoveryListenerHelper を作成します。

パブリック タイプ

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 から EndpointDiscoveryListenerHelperImplEndpointDiscoveryListenerHelper を作成します。

API による内部使用を対象としています。

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

OnEndpointFoundCallback を設定します。

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

OnEndpointLostCallback を設定します。