gpg:: EndpointDiscoveryListenerHelper
#include <endpoint_discovery_listener_helper.h>
מגדיר כלי עזר שיכול לשמש כדי לספק קריאות חוזרות של IEndpointDiscoveryListener ל-SDK בלי להגדיר את הממשק המלא של IEndpointDiscoveryListener.
סיכום
קריאות חוזרות שהוגדרו באובייקט הזה יופעלו כפי שמתואר ב-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.