The Pedigree Project
0.1
|
A vector / dynamic array. More...
#include <Vector.h>
Classes | |
struct | ReverseIteratorContainer |
Public Types | |
typedef T * | Iterator |
typedef T const * | ConstIterator |
typedef ReverseIteratorContainer< T * > | ReverseIterator |
typedef ReverseIteratorContainer< const T * > | ConstReverseIterator |
Public Member Functions | |
Vector () | |
Vector (size_t size) | |
Vector (const Vector &x) | |
~Vector () | |
Vector & | operator= (const Vector &x) |
T & | operator[] (size_t index) const |
size_t | size () const |
size_t | count () const |
void | pushBack (const T &value) |
T | popBack () |
void | pushFront (const T &value) |
T | popFront () |
void | setAt (size_t idx, const T &value) |
void | swap (Iterator a, Iterator b) |
void | insert (size_t index, const T &value) |
void | clear (bool freeMem=false) |
void | erase (size_t index) |
Iterator | erase (Iterator iter) |
ReverseIterator | erase (ReverseIterator iter) |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
ReverseIterator | rbegin () |
ConstReverseIterator | rbegin () const |
ReverseIterator | rend () |
ConstReverseIterator | rend () const |
void | assign (const Vector &x) |
void | reserve (size_t size, bool copy) |
Private Member Functions | |
void | reserve (size_t size, bool copy, bool free) |
Private Attributes | |
size_t | m_Size |
size_t | m_Count |
size_t | m_Start |
T * | m_Data |
Static Private Attributes | |
static const int | m_ReserveFactor = 2 |
A vector / dynamic array.
General Vector template class, aka dynamic array
Definition at line 34 of file Ext2Filesystem.h.
typedef T const* Vector< T >::ConstIterator |
Get an iterator pointing to the beginning of the Vector
Definition at line 148 of file Vector.h.
Referenced by RangeList< T, Reversed >::allocate(), RangeList< T, Reversed >::allocateSpecific(), StreamingScreenLogger::callback(), HostedVirtualAddressSpace::clone(), X64VirtualAddressSpace::clone(), RadixTree< T >::cloneNode(), NetworkStack::deRegisterDevice(), Vector< T >::erase(), IoCommand::execute(), AllocationCommand::execute(), KernelElf::executeModules(), IoPortManager::free(), RangeList< T, Reversed >::free(), X86VirtualAddressSpace::fromFlags(), Log::initialise1(), PosixSubsystem::parseShebang(), Device::removeChild(), Process::removeThread(), Device::replaceChild(), Vector< T >::swap(), and Process::~Process().
|
inline |
Get an iterator pointing to the last element + 1
Definition at line 160 of file Vector.h.
Referenced by RangeList< T, Reversed >::allocate(), RangeList< T, Reversed >::allocateSpecific(), StreamingScreenLogger::callback(), RadixTree< T >::cloneNode(), NetworkStack::deRegisterDevice(), IoCommand::execute(), AllocationCommand::execute(), IoPortManager::free(), RangeList< T, Reversed >::free(), X86VirtualAddressSpace::fromFlags(), Log::initialise1(), Device::removeChild(), Process::removeThread(), Device::replaceChild(), Vector< T >::swap(), PpcCommonPhysicalMemoryManager::unmapRegion(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), and Process::~Process().
|
inline |
|
private |
The number of elements in the Vector
Definition at line 204 of file Vector.h.
Referenced by Vector< T >::assign(), Vector< T >::clear(), Vector< T >::count(), Vector< T >::erase(), Vector< T >::insert(), Vector< T >::operator[](), Vector< T >::popBack(), Vector< T >::popFront(), Vector< T >::pushBack(), Vector< T >::pushFront(), and Vector< T >::setAt().
|
private |
Pointer to the Elements
Definition at line 211 of file Vector.h.
Referenced by Vector< T >::assign(), Vector< T >::clear(), Vector< T >::erase(), Vector< T >::insert(), Vector< T >::operator[](), Vector< T >::popBack(), Vector< T >::popFront(), Vector< T >::pushBack(), Vector< T >::pushFront(), Vector< T >::reserve(), Vector< T >::setAt(), and Vector< T >::~Vector().
|
staticprivate |
Factor to multiply by in reserve().
Definition at line 213 of file Vector.h.
Referenced by Vector< T >::reserve().
|
private |
The number of elements we have reserved space for
Definition at line 202 of file Vector.h.
Referenced by Vector< T >::clear(), Vector< T >::pushBack(), Vector< T >::reserve(), and Vector< T >::size().
|
private |
The current start index in the array. This is used to reduce the need to keep copying the array contents.
Definition at line 209 of file Vector.h.
Referenced by Vector< T >::assign(), Vector< T >::clear(), Vector< T >::erase(), Vector< T >::insert(), Vector< T >::operator[](), Vector< T >::popBack(), Vector< T >::popFront(), Vector< T >::pushBack(), Vector< T >::pushFront(), Vector< T >::reserve(), and Vector< T >::setAt().