| 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 SkTLList_DEFINED | 8 #ifndef SkTLList_DEFINED |
| 9 #define SkTLList_DEFINED | 9 #define SkTLList_DEFINED |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 the list creates the objects and they are deleted upon removal. This class b
lock-allocates | 21 the list creates the objects and they are deleted upon removal. This class b
lock-allocates |
| 22 space for entries based on a param passed to the constructor. | 22 space for entries based on a param passed to the constructor. |
| 23 | 23 |
| 24 Elements of the list can be constructed in place using the following macros: | 24 Elements of the list can be constructed in place using the following macros: |
| 25 SkNEW_INSERT_IN_LLIST_BEFORE(list, location, type_name, args) | 25 SkNEW_INSERT_IN_LLIST_BEFORE(list, location, type_name, args) |
| 26 SkNEW_INSERT_IN_LLIST_AFTER(list, location, type_name, args) | 26 SkNEW_INSERT_IN_LLIST_AFTER(list, location, type_name, args) |
| 27 where list is a SkTLList<type_name>*, location is an iterator, and args is t
he paren-surrounded | 27 where list is a SkTLList<type_name>*, location is an iterator, and args is t
he paren-surrounded |
| 28 constructor arguments for type_name. These macros behave like addBefore() an
d addAfter(). | 28 constructor arguments for type_name. These macros behave like addBefore() an
d addAfter(). |
| 29 */ | 29 */ |
| 30 template <typename T> | 30 template <typename T> |
| 31 class SkTLList : public SkNoncopyable { | 31 class SkTLList : SkNoncopyable { |
| 32 private: | 32 private: |
| 33 struct Block; | 33 struct Block; |
| 34 struct Node { | 34 struct Node { |
| 35 char fObj[sizeof(T)]; | 35 char fObj[sizeof(T)]; |
| 36 SK_DECLARE_INTERNAL_LLIST_INTERFACE(Node); | 36 SK_DECLARE_INTERNAL_LLIST_INTERFACE(Node); |
| 37 Block* fBlock; // owning block. | 37 Block* fBlock; // owning block. |
| 38 }; | 38 }; |
| 39 typedef SkTInternalLList<Node> NodeList; | 39 typedef SkTInternalLList<Node> NodeList; |
| 40 | 40 |
| 41 public: | 41 public: |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 #define SkNEW_INSERT_IN_LLIST_AFTER(list, location, type_name, args) \ | 394 #define SkNEW_INSERT_IN_LLIST_AFTER(list, location, type_name, args) \ |
| 395 (new ((list), SkTLList< type_name >::kAfter_Placement, (location)) type_name
args) | 395 (new ((list), SkTLList< type_name >::kAfter_Placement, (location)) type_name
args) |
| 396 | 396 |
| 397 #define SkNEW_INSERT_AT_LLIST_HEAD(list, type_name, args) \ | 397 #define SkNEW_INSERT_AT_LLIST_HEAD(list, type_name, args) \ |
| 398 SkNEW_INSERT_IN_LLIST_BEFORE((list), (list)->headIter(), type_name, args) | 398 SkNEW_INSERT_IN_LLIST_BEFORE((list), (list)->headIter(), type_name, args) |
| 399 | 399 |
| 400 #define SkNEW_INSERT_AT_LLIST_TAIL(list, type_name, args) \ | 400 #define SkNEW_INSERT_AT_LLIST_TAIL(list, type_name, args) \ |
| 401 SkNEW_INSERT_IN_LLIST_AFTER((list), (list)->tailIter(), type_name, args) | 401 SkNEW_INSERT_IN_LLIST_AFTER((list), (list)->tailIter(), type_name, args) |
| 402 | 402 |
| 403 #endif | 403 #endif |
| OLD | NEW |