OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 DBUS_OBJECT_MANAGER_H_ | 5 #ifndef DBUS_OBJECT_MANAGER_H_ |
6 #define DBUS_OBJECT_MANAGER_H_ | 6 #define DBUS_OBJECT_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 // Called by ObjectManager to inform the implementation class that an | 160 // Called by ObjectManager to inform the implementation class that an |
161 // object has been added with the path |object_path|. The D-Bus interface | 161 // object has been added with the path |object_path|. The D-Bus interface |
162 // name |interface_name| is that passed to RegisterInterface() by the | 162 // name |interface_name| is that passed to RegisterInterface() by the |
163 // implementation class. | 163 // implementation class. |
164 // | 164 // |
165 // If a new object implements multiple interfaces, this method will be | 165 // If a new object implements multiple interfaces, this method will be |
166 // called on each interface implementation with differing values of | 166 // called on each interface implementation with differing values of |
167 // |interface_name| as appropriate. An implementation class will only | 167 // |interface_name| as appropriate. An implementation class will only |
168 // receive multiple calls if it has registered for multiple interfaces. | 168 // receive multiple calls if it has registered for multiple interfaces. |
169 virtual void ObjectAdded(const ObjectPath& object_path, | 169 virtual void ObjectAdded(const ObjectPath& /*object_path*/, |
170 const std::string& interface_name) { } | 170 const std::string& /*interface_name*/) {} |
171 | 171 |
172 // Called by ObjectManager to inform the implementation class than an | 172 // Called by ObjectManager to inform the implementation class than an |
173 // object with the path |object_path| has been removed. Ths D-Bus interface | 173 // object with the path |object_path| has been removed. Ths D-Bus interface |
174 // name |interface_name| is that passed to RegisterInterface() by the | 174 // name |interface_name| is that passed to RegisterInterface() by the |
175 // implementation class. Multiple interfaces are handled as with | 175 // implementation class. Multiple interfaces are handled as with |
176 // ObjectAdded(). | 176 // ObjectAdded(). |
177 // | 177 // |
178 // This method will be called before the Properties structure and the | 178 // This method will be called before the Properties structure and the |
179 // ObjectProxy object for the given interface are cleaned up, it is safe | 179 // ObjectProxy object for the given interface are cleaned up, it is safe |
180 // to retrieve them during removal to vary processing. | 180 // to retrieve them during removal to vary processing. |
181 virtual void ObjectRemoved(const ObjectPath& object_path, | 181 virtual void ObjectRemoved(const ObjectPath& /*object_path*/, |
182 const std::string& interface_name) { } | 182 const std::string& /*interface_name*/) {} |
183 }; | 183 }; |
184 | 184 |
185 // Client code should use Bus::GetObjectManager() instead of this constructor. | 185 // Client code should use Bus::GetObjectManager() instead of this constructor. |
186 ObjectManager(Bus* bus, | 186 ObjectManager(Bus* bus, |
187 const std::string& service_name, | 187 const std::string& service_name, |
188 const ObjectPath& object_path); | 188 const ObjectPath& object_path); |
189 | 189 |
190 // Register a client implementation class |interface| for the given D-Bus | 190 // Register a client implementation class |interface| for the given D-Bus |
191 // interface named in |interface_name|. That object's CreateProperties() | 191 // interface named in |interface_name|. That object's CreateProperties() |
192 // method will be used to create instances of dbus::PropertySet* when | 192 // method will be used to create instances of dbus::PropertySet* when |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // Note: This should remain the last member so it'll be destroyed and | 355 // Note: This should remain the last member so it'll be destroyed and |
356 // invalidate its weak pointers before any other members are destroyed. | 356 // invalidate its weak pointers before any other members are destroyed. |
357 base::WeakPtrFactory<ObjectManager> weak_ptr_factory_; | 357 base::WeakPtrFactory<ObjectManager> weak_ptr_factory_; |
358 | 358 |
359 DISALLOW_COPY_AND_ASSIGN(ObjectManager); | 359 DISALLOW_COPY_AND_ASSIGN(ObjectManager); |
360 }; | 360 }; |
361 | 361 |
362 } // namespace dbus | 362 } // namespace dbus |
363 | 363 |
364 #endif // DBUS_OBJECT_MANAGER_H_ | 364 #endif // DBUS_OBJECT_MANAGER_H_ |
OLD | NEW |