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 SkTInternalLList_DEFINED | 8 #ifndef SkTInternalLList_DEFINED |
9 #define SkTInternalLList_DEFINED | 9 #define SkTInternalLList_DEFINED |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #define SK_DECLARE_INTERNAL_LLIST_INTERFACE(ClassName) \ | 31 #define SK_DECLARE_INTERNAL_LLIST_INTERFACE(ClassName) \ |
32 friend class SkTInternalLList<ClassName>; \ | 32 friend class SkTInternalLList<ClassName>; \ |
33 /* back pointer to the owning list - for debugging */ \ | 33 /* back pointer to the owning list - for debugging */ \ |
34 SkDEBUGCODE(SkPtrWrapper<SkTInternalLList<ClassName> > fList;) \ | 34 SkDEBUGCODE(SkPtrWrapper<SkTInternalLList<ClassName> > fList;) \ |
35 SkPtrWrapper<ClassName> fPrev; \ | 35 SkPtrWrapper<ClassName> fPrev; \ |
36 SkPtrWrapper<ClassName> fNext | 36 SkPtrWrapper<ClassName> fNext |
37 | 37 |
38 /** | 38 /** |
39 * This class implements a templated internal doubly linked list data structure. | 39 * This class implements a templated internal doubly linked list data structure. |
40 */ | 40 */ |
41 template <class T> class SkTInternalLList : public SkNoncopyable { | 41 template <class T> class SkTInternalLList : SkNoncopyable { |
42 public: | 42 public: |
43 SkTInternalLList() | 43 SkTInternalLList() |
44 : fHead(NULL) | 44 : fHead(NULL) |
45 , fTail(NULL) { | 45 , fTail(NULL) { |
46 } | 46 } |
47 | 47 |
48 void remove(T* entry) { | 48 void remove(T* entry) { |
49 SkASSERT(NULL != fHead && NULL != fTail); | 49 SkASSERT(NULL != fHead && NULL != fTail); |
50 SkASSERT(this->isInList(entry)); | 50 SkASSERT(this->isInList(entry)); |
51 | 51 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 #endif // SK_DEBUG | 263 #endif // SK_DEBUG |
264 | 264 |
265 private: | 265 private: |
266 T* fHead; | 266 T* fHead; |
267 T* fTail; | 267 T* fTail; |
268 | 268 |
269 typedef SkNoncopyable INHERITED; | 269 typedef SkNoncopyable INHERITED; |
270 }; | 270 }; |
271 | 271 |
272 #endif | 272 #endif |
OLD | NEW |