Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.

gpg::EndpointDiscoveryListenerHelper

#include <endpoint_discovery_listener_helper.h>

Xác định 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 được đị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à hàm dựng

EndpointDiscoveryListenerHelper()
EndpointDiscoveryListenerHelper(std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl)
Tạo EndpointDiscoveryListenerHelper từ shared_ptr sang 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 thể phát hiện một điểm cuối từ xa.

Hàm công khai

SetOnEndpointFoundCallback(OnEndpointFoundCallback callback)
Đặt OnEndpointFoundCallback.
SetOnEndpointLostCallback(OnEndpointLostCallback callback)
Thiết lập OnEndpointLosCallback.

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 thấy đ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.

OnEndpoint Truy thế lại

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

OnEndpointLostCallback được gọi khi không thể phát hiện một điểm cuối từ xa.

Hàm công khai

Trình trợ giúp điểm phát hiện

 EndpointDiscoveryListenerHelper()

Trình trợ giúp điểm phát hiện

 EndpointDiscoveryListenerHelper(
  std::shared_ptr< EndpointDiscoveryListenerHelperImpl > impl
)

Tạo EndpointDiscoveryListenerHelper từ shared_ptr sang EndpointDiscoveryListenerHelperImpl.

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

SetOnEndpointFoundCallback

EndpointDiscoveryListenerHelper & SetOnEndpointFoundCallback(
  OnEndpointFoundCallback callback
)

Đặt OnEndpointFoundCallback.

SetOnEndpointLosCallback

EndpointDiscoveryListenerHelper & SetOnEndpointLostCallback(
  OnEndpointLostCallback callback
)

Thiết lập OnEndpointLosCallback.