mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Create PresenceDeviceProvider
PiperOrigin-RevId: 528913199
This commit is contained in:
committed by
Copybara-Service
parent
6b25d430d9
commit
21d2efbccd
@@ -10,6 +10,7 @@ cc_library(
|
||||
],
|
||||
deps = [
|
||||
"//internal/platform:connection_info",
|
||||
"//internal/platform:types",
|
||||
"@com_google_absl//absl/strings",
|
||||
"@com_google_absl//absl/types:variant",
|
||||
],
|
||||
|
||||
@@ -41,10 +41,6 @@ class NearbyDevice {
|
||||
};
|
||||
NearbyDevice() = default;
|
||||
virtual ~NearbyDevice() = default;
|
||||
NearbyDevice(NearbyDevice&&) = default;
|
||||
NearbyDevice& operator=(NearbyDevice&&) = default;
|
||||
NearbyDevice(const NearbyDevice&) = delete;
|
||||
NearbyDevice& operator=(const NearbyDevice&) = delete;
|
||||
virtual std::string GetEndpointId() const = 0;
|
||||
// We will be adding more ConnectionInfo types to this variant as they are
|
||||
// implemented.
|
||||
|
||||
@@ -22,10 +22,13 @@ namespace nearby {
|
||||
// The base device provider class for use with the Nearby Connections V3 APIs.
|
||||
// This class currently provides a function to get the local device for whatever
|
||||
// client implements it.
|
||||
template <typename T, typename std::enable_if<std::is_base_of<
|
||||
::nearby::NearbyDevice, T>::value>::type* = nullptr>
|
||||
class NearbyDeviceProvider {
|
||||
public:
|
||||
virtual ~NearbyDeviceProvider() = default;
|
||||
|
||||
virtual NearbyDevice* GetLocalDevice() = 0;
|
||||
const virtual T& GetLocalDevice() = 0;
|
||||
};
|
||||
} // namespace nearby
|
||||
|
||||
|
||||
Reference in New Issue
Block a user