gpg:: EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
מגדיר כלי עזר שיכול לשמש כדי לספק קריאות חוזרות (callback) של 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 שגילה את נקודת הקצה. 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.