gpg:: EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
完全な IEndpointDiscoveryListener インターフェースを定義せずに SDK に IEndpointDiscoveryListener コールバックを提供するために使用できるヘルパーを定義します。
まとめ
このオブジェクトに設定されているコールバックは、付近の接続 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 を設定します。