gpg:: EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
กำหนดตัวช่วยที่สามารถใช้เพื่อให้การเรียกกลับ IEndpointDiscoveryListener ไปยัง SDK โดยไม่ต้องกำหนดอินเทอร์เฟซ IEndpointDiscoveryListener เท่านั้นได้
สรุป
ระบบจะเรียกใช้ Callback ที่กำหนดค่าไว้ในออบเจ็กต์นี้ตามที่อธิบายไว้ใน API การเชื่อมต่อใกล้เคียง Callback ที่ไม่ได้ตั้งค่าไว้อย่างชัดแจ้งจะไม่ส่งผลใดๆ
ผู้ผลิตและผู้ทำลาย |
|
---|---|
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 ที่ค้นพบปลายทาง 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 )
สร้าง EndpointDiscoveryListenerHelper จาก shared_ptr
ไปยัง EndpointDiscoveryListenerHelperImpl
มีไว้เพื่อใช้ภายในโดย API
SetOnEndpointFoundCallback
EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback( OnEndpointFoundCallback callback )
ตั้งค่า OnEndpointFoundCallback
SetOnEndpointLostCallback
EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback( OnEndpointLostCallback callback )
ตั้งค่า OnEndpointLostCallback