gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

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

ملخّص

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

الدلالة والهياكل

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

الأنواع العلنية

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