OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_PROPERTY_BAG_H_ | 5 #ifndef CHROME_COMMON_PROPERTY_BAG_H_ |
6 #define CHROME_COMMON_PROPERTY_BAG_H_ | 6 #define CHROME_COMMON_PROPERTY_BAG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/linked_ptr.h" | |
13 | 12 |
| 13 template <typename T> |
| 14 class linked_ptr; |
14 class PropertyAccessorBase; | 15 class PropertyAccessorBase; |
15 | 16 |
16 // A property bag holds a generalized list of arbitrary metadata called | 17 // A property bag holds a generalized list of arbitrary metadata called |
17 // properties. Each property is a class type derived from PropertyBag::Prop | 18 // properties. Each property is a class type derived from PropertyBag::Prop |
18 // that can bet set and retrieved. | 19 // that can bet set and retrieved. |
19 // | 20 // |
20 // The property bag is not read or written directly. Instead, callers go | 21 // The property bag is not read or written directly. Instead, callers go |
21 // through a PropertyAccessor. The Accessor generates the unique IDs that | 22 // through a PropertyAccessor. The Accessor generates the unique IDs that |
22 // identify different properties. The Accessor is templatized to also provide | 23 // identify different properties. The Accessor is templatized to also provide |
23 // typesafety to the callers. | 24 // typesafety to the callers. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return new Container(data_); | 166 return new Container(data_); |
166 } | 167 } |
167 | 168 |
168 T data_; | 169 T data_; |
169 }; | 170 }; |
170 | 171 |
171 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor); | 172 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor); |
172 }; | 173 }; |
173 | 174 |
174 #endif // CHROME_COMMON_PROPERTY_BAG_H_ | 175 #endif // CHROME_COMMON_PROPERTY_BAG_H_ |
OLD | NEW |