Lines Matching refs:Alignment
38 template<typename T, deUint32 Alignment>
41 template<typename T, deUint32 Alignment>
51 template<typename T, deUint32 Alignment = (sizeof(T) > sizeof(void*) ? (deUint32)sizeof(void*) : (deUint32)sizeof(T))>
55 typedef PoolArrayIterator<T, Alignment> Iterator;
56 typedef PoolArrayConstIterator<T, Alignment> ConstIterator;
62 PoolArray (MemPool* pool, const PoolArray<T, Alignment>& other);
101 PoolArray (const PoolArray<T, Alignment>& other); // \note Default copy ctor is not allowed, use PoolArray(pool, copy) instead.
114 template<typename T, deUint32 Alignment>
127 template<typename T, deUint32 Alignment>
128 class PoolArrayConstIterator : public PoolArrayIteratorBase<T, Alignment>
132 PoolArrayConstIterator (const PoolArray<T, Alignment>* array, deIntptr ndx);
133 PoolArrayConstIterator (const PoolArrayIterator<T, Alignment>& iterator);
138 const PoolArray<T, Alignment>* getArray (void) const throw() { return m_array; }
146 PoolArrayConstIterator<T, Alignment>& operator++ (void) { this->m_ndx += 1; return *this; }
147 PoolArrayConstIterator<T, Alignment>& operator-- (void) { this->m_ndx -= 1; return *this; }
150 PoolArrayConstIterator<T, Alignment> operator++ (int) { PoolArrayConstIterator<T, Alignment> copy(*this); this->m_ndx +=1; return copy; }
151 PoolArrayConstIterator<T, Alignment> operator-- (int) { PoolArrayConstIterator<T, Alignment> copy(*this); this->m_ndx -=1; return copy; }
154 PoolArrayConstIterator<T, Alignment>& operator+= (deIntptr offs) { this->m_ndx += offs; return *this; }
155 PoolArrayConstIterator<T, Alignment>& operator-= (deIntptr offs) { this->m_ndx -= offs; return *this; }
158 PoolArrayConstIterator<T, Alignment>& operator= (const PoolArrayIterator<T, Alignment>& iter);
161 const PoolArray<T, Alignment>* m_array;
164 template<typename T, deUint32 Alignment>
165 class PoolArrayIterator : public PoolArrayIteratorBase<T, Alignment>
169 PoolArrayIterator (PoolArray<T, Alignment>* array, deIntptr ndx);
174 PoolArray<T, Alignment>* getArray (void) const throw() { return m_array; }
182 PoolArrayIterator<T, Alignment>& operator++ (void) { this->m_ndx += 1; return *this; }
183 PoolArrayIterator<T, Alignment>& operator-- (void) { this->m_ndx -= 1; return *this; }
186 PoolArrayIterator<T, Alignment> operator++ (int) { PoolArrayIterator<T, Alignment> copy(*this); this->m_ndx +=1; return copy; }
187 PoolArrayIterator<T, Alignment> operator-- (int) { PoolArrayIterator<T, Alignment> copy(*this); this->m_ndx -=1; return copy; }
190 PoolArrayIterator<T, Alignment>& operator+= (deIntptr offs) { this->m_ndx += offs; return *this; }
191 PoolArrayIterator<T, Alignment>& operator-= (deIntptr offs) { this->m_ndx -= offs; return *this; }
194 PoolArray<T, Alignment>* m_array;
225 template<typename T, deUint32 Alignment>
226 PoolArray<T, Alignment>::PoolArray (MemPool* pool)
233 DE_ASSERT(deIsPowerOfTwo32(Alignment));
236 template<typename T, deUint32 Alignment>
237 PoolArray<T, Alignment>::~PoolArray (void)
243 template<typename T, deUint32 Alignment>
244 inline void PoolArray<T, Alignment>::clear (void)
249 template<typename T, deUint32 Alignment>
250 inline void PoolArray<T, Alignment>::resize (deUintptr newSize)
273 template<typename T, deUint32 Alignment>
274 inline void PoolArray<T, Alignment>::resize (deUintptr newSize, const T& value)
291 template<typename T, deUint32 Alignment>
292 inline void PoolArray<T, Alignment>::reserve (deUintptr capacity)
324 deUintptr elementSize = (deUintptr)deAlignPtr((void*)(deUintptr)sizeof(T), Alignment);
331 void* newPage = deAlignPtr(oldPageTable, Alignment);
335 break; // No free space for alloc + alignment.
349 m_pageTable[pageTableNdx] = m_pool->alignedAlloc(pageAllocSize, Alignment);
358 template<typename T, deUint32 Alignment>
359 inline void PoolArray<T, Alignment>::pushBack (const T& value)
365 template<typename T, deUint32 Alignment>
366 inline T PoolArray<T, Alignment>::popBack (void)
373 template<typename T, deUint32 Alignment>
374 inline T* PoolArray<T, Alignment>::getPtr (deIntptr ndx) const
379 deUintptr elemSize = (deUintptr)deAlignPtr((void*)(deUintptr)sizeof(T), Alignment);
381 DE_ASSERT(deIsAlignedPtr(ptr, Alignment));
387 template<typename T, deUint32 Alignment>
388 inline bool operator== (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
394 template<typename T, deUint32 Alignment>
395 inline bool operator!= (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
401 template<typename T, deUint32 Alignment>
402 inline bool operator< (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
407 template<typename T, deUint32 Alignment>
408 inline bool operator> (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
413 template<typename T, deUint32 Alignment>
414 inline bool operator<= (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
419 template<typename T, deUint32 Alignment>
420 inline bool operator>= (const PoolArrayIteratorBase<T, Alignment>& a, const PoolArrayIteratorBase<T, Alignment>& b)
427 template<typename T, deUint32 Alignment>
428 inline PoolArrayConstIterator<T, Alignment>::PoolArrayConstIterator (void)
429 : PoolArrayIteratorBase<T, Alignment> (0)
434 template<typename T, deUint32 Alignment>
435 inline PoolArrayConstIterator<T, Alignment>::PoolArrayConstIterator (const PoolArray<T, Alignment>* array, deIntptr ndx)
436 : PoolArrayIteratorBase<T, Alignment> (ndx)
441 template<typename T, deUint32 Alignment>
442 inline PoolArrayConstIterator<T, Alignment>::PoolArrayConstIterator (const PoolArrayIterator<T, Alignment>& iter)
443 : PoolArrayIteratorBase<T, Alignment> (iter)
448 template<typename T, deUint32 Alignment>
449 inline PoolArrayConstIterator<T, Alignment>::~PoolArrayConstIterator (void)
455 template<typename T, deUint32 Alignment>
456 inline PoolArrayConstIterator<T, Alignment> operator+ (const PoolArrayConstIterator<T, Alignment>& iter, deIntptr offs)
458 return PoolArrayConstIterator<T, Alignment>(iter->getArray(), iter->getNdx()+offs);
461 template<typename T, deUint32 Alignment>
462 inline PoolArrayConstIterator<T, Alignment> operator+ (deUintptr offs, const PoolArrayConstIterator<T, Alignment>& iter)
464 return PoolArrayConstIterator<T, Alignment>(iter->getArray(), iter->getNdx()+offs);
467 template<typename T, deUint32 Alignment>
468 PoolArrayConstIterator<T, Alignment> operator- (const PoolArrayConstIterator<T, Alignment>& iter, deIntptr offs)
470 return PoolArrayConstIterator<T, Alignment>(iter.getArray(), iter.getNdx()-offs);
473 template<typename T, deUint32 Alignment>
474 deIntptr operator- (const PoolArrayConstIterator<T, Alignment>& iter, const PoolArrayConstIterator<T, Alignment>& other)
481 template<typename T, deUint32 Alignment>
482 inline PoolArrayIterator<T, Alignment>::PoolArrayIterator (void)
483 : PoolArrayIteratorBase<T, Alignment> (0)
488 template<typename T, deUint32 Alignment>
489 inline PoolArrayIterator<T, Alignment>::PoolArrayIterator (PoolArray<T, Alignment>* array, deIntptr ndx)
490 : PoolArrayIteratorBase<T, Alignment> (ndx)
495 template<typename T, deUint32 Alignment>
496 inline PoolArrayIterator<T, Alignment>::~PoolArrayIterator (void)
502 template<typename T, deUint32 Alignment>
503 inline PoolArrayIterator<T, Alignment> operator+ (const PoolArrayIterator<T, Alignment>& iter, deIntptr offs)
505 return PoolArrayIterator<T, Alignment>(iter.getArray(), iter.getNdx()+offs);
508 template<typename T, deUint32 Alignment>
509 inline PoolArrayIterator<T, Alignment> operator+ (deUintptr offs, const PoolArrayIterator<T, Alignment>& iter)
511 return PoolArrayIterator<T, Alignment>(iter.getArray(), iter.getNdx()+offs);
514 template<typename T, deUint32 Alignment>
515 PoolArrayIterator<T, Alignment> operator- (const PoolArrayIterator<T, Alignment>& iter, deIntptr offs)
517 return PoolArrayIterator<T, Alignment>(iter.getArray(), iter.getNdx()-offs);
520 template<typename T, deUint32 Alignment>
521 deIntptr operator- (const PoolArrayIterator<T, Alignment>& iter, const PoolArrayIterator<T, Alignment>& other)
532 template<typename T, deUint32 Alignment>
533 struct iterator_traits<de::PoolArrayConstIterator<T, Alignment> >
542 template<typename T, deUint32 Alignment>
543 struct iterator_traits<de::PoolArrayIterator<T, Alignment> >