gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

تحدّد هذه السياسة أداة مساعدة يمكن استخدامها لتوفير استدعاءات IEndpointDiscoveryListener لحزمة SDK بدون تحديد واجهة IEndpointDiscoveryListener الكاملة.

ملخّص

سيتم استدعاء عمليات معاودة الاتصال التي تم ضبطها على هذا العنصر، كما هو موضَّح في واجهة برمجة تطبيقات الاتصالات القريبة. لن تؤدي عمليات معاودة الاتصال التي لم يتم ضبطها بشكل صريح إلى أي تأثير.

الشركات المصنّعة والمُصنّعة

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
إنشاء EndpointDiscoveryListenerHelper من shared_ptr إلى EndpointDiscoveryListenerHelperImpl.

الأنواع العامة

OnEndpointFoundCallback تعريف الكتابة
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
يتم استدعاء الدالة OnEndpointFoundCallback عند العثور على نقطة نهاية بعيدة.
OnEndpointLostCallback تعريف الكتابة
std::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.

مخصص للاستخدام الداخلي من خلال واجهة برمجة التطبيقات.

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

اضبط OnEndpointFoundCallback.

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

اضبط OnEndpointLostCallback.