gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

Xác định một trình trợ giúp có thể dùng để cung cấp lệnh gọi lại IEndpointDiscoveryListener cho SDK mà không cần xác định giao diện IEndpointDiscoveryListener đầy đủ.

Tóm tắt

Các lệnh gọi lại đã định cấu hình trên đối tượng này sẽ được gọi như mô tả trong API kết nối lân cận. Các lệnh gọi lại không được đặt rõ ràng sẽ không có tác dụng gì.

Hàm khởi tạo và phá huỷ

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
Tạo EndpointDiscoveryListenerHelper từ shared_ptr đến EndpointDiscoveryListenerHelperImpl.

Loại công khai

OnEndpointFoundCallback typedef
std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)>
OnEndpointFoundCallback được gọi khi tìm thấy một điểm cuối từ xa.
OnEndpointLostCallback typedef
std::function< void(int64_t client_id, const std::string &remote_endpoint_id)>
OnEndpointLostCallback được gọi khi không còn tìm thấy điểm cuối từ xa.

Hàm công khai

SetOnEndpointFoundCallback(OnEndpointFoundCallback callback)
Đặt OnEndpointFoundCallback.
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
Thiết lập OnEndpoint mấtCallback.

Loại công khai

OnEndpointFoundCallback

std::function< void(int64_t client_id, const EndpointDetails &endpoint_details)> OnEndpointFoundCallback

OnEndpointFoundCallback được gọi khi tìm thấy một điểm cuối từ xa.

client_id là mã nhận dạng của thực thể NearbyConnections đã phát hiện điểm cuối. endpoint_details chứa thông tin chi tiết về điểm cuối từ xa được phát hiện.

OnEndpointLostCallback

std::function< void(int64_t client_id, const std::string &remote_endpoint_id)> OnEndpointLostCallback

OnEndpointLostCallback được gọi khi không còn tìm thấy điểm cuối từ xa.

Hàm công khai

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper()

EndpointDiscoveryListenerHelper

 EndpointDiscoveryListenerHelper(
  std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl
)

Tạo EndpointDiscoveryListenerHelper từ shared_ptr thành EndpointDiscoveryListenerHelperImpl.

Dành cho API sử dụng nội bộ.

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

Đặt OnEndpointFoundCallback.

SetOnEndpointLostCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

Thiết lập OnEndpoint mấtCallback.