OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Notifies observers. | 76 // Notifies observers. |
77 void NotifyDescriptorAdded(const dbus::ObjectPath& object_path); | 77 void NotifyDescriptorAdded(const dbus::ObjectPath& object_path); |
78 void NotifyDescriptorRemoved(const dbus::ObjectPath& object_path); | 78 void NotifyDescriptorRemoved(const dbus::ObjectPath& object_path); |
79 | 79 |
80 // Mapping from object paths to Properties structures. | 80 // Mapping from object paths to Properties structures. |
81 struct DescriptorData { | 81 struct DescriptorData { |
82 DescriptorData(); | 82 DescriptorData(); |
83 ~DescriptorData(); | 83 ~DescriptorData(); |
84 | 84 |
85 scoped_ptr<Properties> properties; | 85 scoped_ptr<Properties> properties; |
86 std::vector<uint8> value; | |
87 }; | 86 }; |
88 typedef std::map<dbus::ObjectPath, DescriptorData*> PropertiesMap; | 87 typedef std::map<dbus::ObjectPath, DescriptorData*> PropertiesMap; |
89 PropertiesMap properties_; | 88 PropertiesMap properties_; |
90 | 89 |
91 // List of observers interested in event notifications from us. | 90 // List of observers interested in event notifications from us. |
92 ObserverList<Observer> observers_; | 91 ObserverList<Observer> observers_; |
93 | 92 |
94 // Weak pointer factory for generating 'this' pointers that might live longer | 93 // Weak pointer factory for generating 'this' pointers that might live longer |
95 // than we do. | 94 // than we do. |
96 // Note: This should remain the last member so it'll be destroyed and | 95 // Note: This should remain the last member so it'll be destroyed and |
97 // invalidate its weak pointers before any other members are destroyed. | 96 // invalidate its weak pointers before any other members are destroyed. |
98 base::WeakPtrFactory<FakeBluetoothGattDescriptorClient> | 97 base::WeakPtrFactory<FakeBluetoothGattDescriptorClient> |
99 weak_ptr_factory_; | 98 weak_ptr_factory_; |
100 | 99 |
101 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient); | 100 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient); |
102 }; | 101 }; |
103 | 102 |
104 } // namespace chromeos | 103 } // namespace chromeos |
105 | 104 |
106 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 105 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
OLD | NEW |