Changeset 10567
- Timestamp:
- Sep 8, 2015, 4:16:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/object/ObjectList.h
r10467 r10567 74 74 typedef ObjectListIterator<T> iterator; 75 75 76 /// Returns the size of the list (for the root context) 77 inline static size_t size() 78 { return size(Context::getRootContext()); } 76 79 /// Returns the size of the list 77 inline static size_t size( )80 inline static size_t size(Context* context) 78 81 { 79 return Context::getRootContext()->getObjectList<T>()->size();82 return context->getObjectList<T>()->size(); 80 83 } 81 84 85 /// Returns an Iterator to the first element in the list (for the root context). 86 inline static ObjectListElement<T>* begin() 87 { return begin(Context::getRootContext()); } 82 88 /// Returns an Iterator to the first element in the list. 83 inline static ObjectListElement<T>* begin( )89 inline static ObjectListElement<T>* begin(Context* context) 84 90 { 85 ObjectListBase* list = Context::getRootContext()->getObjectList<T>();91 ObjectListBase* list = context->getObjectList<T>(); 86 92 return static_cast<ObjectListElement<T>*>(list->begin()); 87 93 } 88 94 95 /// Returns an Iterator to the element after the last element in the list (for the root context). 96 inline static ObjectListElement<T>* end() 97 { return end(Context::getRootContext()); } 89 98 /// Returns an Iterator to the element after the last element in the list. 90 inline static ObjectListElement<T>* end( )99 inline static ObjectListElement<T>* end(Context* context) 91 100 { 92 ObjectListBase* list = Context::getRootContext()->getObjectList<T>();101 ObjectListBase* list = context->getObjectList<T>(); 93 102 return static_cast<ObjectListElement<T>*>(list->end()); 94 103 } 95 104 105 /// Returns an Iterator to the last element in the list (for the root context). 106 inline static ObjectListElement<T>* rbegin() 107 { return rbegin(Context::getRootContext()); } 96 108 /// Returns an Iterator to the last element in the list. 97 inline static ObjectListElement<T>* rbegin( )109 inline static ObjectListElement<T>* rbegin(Context* context) 98 110 { 99 ObjectListBase* list = Context::getRootContext()->getObjectList<T>();111 ObjectListBase* list = context->getObjectList<T>(); 100 112 return static_cast<ObjectListElement<T>*>(list->rbegin()); 101 113 } 102 114 115 /// Returns an Iterator to the element before the first element in the list (for the root context). 116 inline static ObjectListElement<T>* rend() 117 { return rend(Context::getRootContext()); } 103 118 /// Returns an Iterator to the element before the first element in the list. 104 inline static ObjectListElement<T>* rend( )119 inline static ObjectListElement<T>* rend(Context* context) 105 120 { 106 ObjectListBase* list = Context::getRootContext()->getObjectList<T>();121 ObjectListBase* list = context->getObjectList<T>(); 107 122 return static_cast<ObjectListElement<T>*>(list->rend()); 108 123 }
Note: See TracChangeset
for help on using the changeset viewer.