| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkTSet_DEFINED | 8 #ifndef SkTSet_DEFINED |
| 9 #define SkTSet_DEFINED | 9 #define SkTSet_DEFINED |
| 10 | 10 |
| 11 #include "SkTDArray.h" | 11 #include "SkTDArray.h" |
| 12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
| 13 | 13 |
| 14 /** \class SkTSet<T> | 14 /** \class SkTSet<T> |
| 15 | 15 |
| 16 The SkTSet template class defines a set. | 16 The SkTSet template class defines a set. |
| 17 Main operations supported now are: add, merge, find and contains. | 17 Main operations supported now are: add, merge, find and contains. |
| 18 | 18 |
| 19 TSet<T> is mutable. | 19 TSet<T> is mutable. |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 // TODO: Add remove, intersect and difference operations. | 22 // TODO: Add remove, intersect and difference operations. |
| 23 // TODO: Add bench tests. | 23 // TODO: Add bench tests. |
| 24 template <typename T> class SK_API SkTSet { | 24 template <typename T> class SkTSet { |
| 25 public: | 25 public: |
| 26 SkTSet() { | 26 SkTSet() { |
| 27 fArray = SkNEW(SkTDArray<T>); | 27 fArray = SkNEW(SkTDArray<T>); |
| 28 } | 28 } |
| 29 | 29 |
| 30 ~SkTSet() { | 30 ~SkTSet() { |
| 31 SkASSERT(fArray); | 31 SkASSERT(fArray); |
| 32 SkDELETE(fArray); | 32 SkDELETE(fArray); |
| 33 } | 33 } |
| 34 | 34 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 return true; | 272 return true; |
| 273 } | 273 } |
| 274 #endif | 274 #endif |
| 275 | 275 |
| 276 private: | 276 private: |
| 277 SkTDArray<T>* fArray; | 277 SkTDArray<T>* fArray; |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 #endif | 280 #endif |
| OLD | NEW |