OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "dbus/object_path.h" |
| 13 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 14 |
| 15 namespace bluez { |
| 16 |
| 17 // The BluetoothGattCharacteristicBlueZ class implements |
| 18 // BluetoothRemoteGattCharacteristic for GATT characteristics for platforms |
| 19 // that use BlueZ. |
| 20 class BluetoothGattCharacteristicBlueZ |
| 21 : public virtual device::BluetoothGattCharacteristic { |
| 22 public: |
| 23 // device::BluetoothGattCharacteristic overrides. |
| 24 std::string GetIdentifier() const override; |
| 25 |
| 26 // Object path of the underlying D-Bus characteristic. |
| 27 const dbus::ObjectPath& object_path() const { return object_path_; } |
| 28 |
| 29 protected: |
| 30 explicit BluetoothGattCharacteristicBlueZ( |
| 31 const dbus::ObjectPath& object_path); |
| 32 ~BluetoothGattCharacteristicBlueZ() override; |
| 33 |
| 34 private: |
| 35 // Object path of the D-Bus characteristic object. |
| 36 dbus::ObjectPath object_path_; |
| 37 |
| 38 // Note: This should remain the last member so it'll be destroyed and |
| 39 // invalidate its weak pointers before any other members are destroyed. |
| 40 base::WeakPtrFactory<BluetoothGattCharacteristicBlueZ> weak_ptr_factory_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicBlueZ); |
| 43 }; |
| 44 |
| 45 } // namespace bluez |
| 46 |
| 47 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_CHARACTERISTIC_BLUEZ_H_ |
OLD | NEW |