Create PresenceDeviceProvider

PiperOrigin-RevId: 528913199
This commit is contained in:
Anay Wadhera
2023-05-02 16:02:36 -07:00
committed by Copybara-Service
parent 6b25d430d9
commit 21d2efbccd
17 changed files with 204 additions and 11 deletions
+1
View File
@@ -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",
],
-4
View File
@@ -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.
+4 -1
View File
@@ -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
+1
View File
@@ -348,6 +348,7 @@ cc_library(
"//fastpair:__subpackages__",
"//internal/base:__subpackages__",
"//internal/flags:__subpackages__",
"//internal/interop:__pkg__",
"//internal/platform/implementation/windows:__subpackages__",
"//internal/preferences:__subpackages__",
"//internal/test:__subpackages__",