gpg:: EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
IEndpointDiscoveryListener インターフェース全体を定義せずに、SDK に IEndpointDiscoveryListener コールバックを提供するために使用できるヘルパーを定義します。
概要
このオブジェクトで構成されたコールバックは、Nearby Connections API で説明されているように呼び出されます。コールバックが明示的に設定されていない場合、何も実行されません。
コンストラクタとデストラクタ |
|
---|---|
EndpointDiscoveryListenerHelper()
|
|
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
|
パブリック タイプ |
|
---|---|
OnEndpointFoundCallback
|
typedefstd::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback は、リモート エンドポイントが検出されたときに呼び出されます。 |
OnEndpointLostCallback
|
typedefstd::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 を設定します。