Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
List of all members
Vector< Element > Class Template Reference
Vector class template. More...
#include <WVector.h>
Inheritance diagram for Vector< Element >:
Collaboration diagram for Vector< Element >:
Public Types | |
| typedef int(* | Comparer) (const Element &lhs, const Element &rhs) |
Public Member Functions | |
| Vector (unsigned int initialCapacity=10, unsigned int capacityIncrement=10) | |
| Vector (const Vector &rhv) | |
| ~Vector () | |
| unsigned int | capacity () const |
| bool | contains (const Element &elem) const |
| const Element & | firstElement () const |
| int | indexOf (const Element &elem) const |
| bool | isEmpty () const |
| const Element & | lastElement () const |
| int | lastIndexOf (const Element &elem) const |
| unsigned int | count () const override |
| unsigned int | size () const |
| void | copyInto (Element *array) const |
| bool | add (const Element &obj) |
| bool | addElement (const Element &obj) |
| bool | addElement (Element *objp) |
| void | clear () |
| bool | ensureCapacity (unsigned int minCapacity) |
| void | removeAllElements () |
| bool | removeElement (const Element &obj) |
| bool | setSize (unsigned int newSize) |
| void | trimToSize () |
| const Element & | elementAt (unsigned int index) const |
| bool | insertElementAt (const Element &obj, unsigned int index) |
| const void | remove (unsigned int index) |
| void | removeElementAt (unsigned int index) |
| bool | setElementAt (const Element &obj, unsigned int index) |
| const Element & | get (unsigned int index) const |
| const Element & | operator[] (unsigned int index) const override |
| Element & | operator[] (unsigned int index) override |
| const Vector< Element > & | operator= (const Vector< Element > &rhv) |
| const Vector< Element > & | operator= (const Vector< Element > &&other) |
| void | sort (Comparer compareFunction) |
| const Element & | at (unsigned int i) const |
Protected Member Functions | |
| void | copyFrom (const Vector &rhv) |
Protected Attributes | |
| unsigned int | _size = 0 |
| unsigned int | _capacity = 0 |
| unsigned int | _increment |
| Element ** | _data = nullptr |
Detailed Description
template<typename Element>
class Vector< Element >
Vector class template.
Member Typedef Documentation
◆ Comparer
template<typename Element>
| typedef int(* Vector< Element >::Comparer) (const Element &lhs, const Element &rhs) |
Constructor & Destructor Documentation
◆ Vector() [1/2]
template<class Element >
| Vector< Element >::Vector | ( | unsigned int | initialCapacity = 10, |
| unsigned int | capacityIncrement = 10 |
||
| ) |
◆ Vector() [2/2]
◆ ~Vector()
Member Function Documentation
◆ add()
◆ addElement() [1/2]
◆ addElement() [2/2]
◆ at()
◆ capacity()
◆ clear()
template<typename Element>
|
inline |
◆ contains()
◆ copyFrom()
template<class Element >
|
protected |
◆ copyInto()
template<class Element>
| void Vector< Element >::copyInto | ( | Element * | array | ) | const |
◆ count()
Implements Countable< Element >.
◆ elementAt()
◆ ensureCapacity()
◆ firstElement()
template<class Element >
| const Element & Vector< Element >::firstElement | ( | ) | const |
◆ get()
◆ indexOf()
◆ insertElementAt()
template<class Element>
| bool Vector< Element >::insertElementAt | ( | const Element & | obj, |
| unsigned int | index | ||
| ) |
◆ isEmpty()
◆ lastElement()
template<class Element >
| const Element & Vector< Element >::lastElement | ( | ) | const |
◆ lastIndexOf()
◆ operator=() [1/2]
template<typename Element>
|
inline |
◆ operator=() [2/2]
template<typename Element>
|
inline |
◆ operator[]() [1/2]
template<class Element >
|
overridevirtual |
Implements Countable< Element >.
◆ operator[]() [2/2]
template<class Element >
|
overridevirtual |
Implements Countable< Element >.
◆ remove()
◆ removeAllElements()
template<class Element >
| void Vector< Element >::removeAllElements | ( | ) |
◆ removeElement()
◆ removeElementAt()
◆ setElementAt()
template<class Element>
| bool Vector< Element >::setElementAt | ( | const Element & | obj, |
| unsigned int | index | ||
| ) |
◆ setSize()
◆ size()
◆ sort()
◆ trimToSize()
template<class Element >
| void Vector< Element >::trimToSize | ( | ) |
Member Data Documentation
◆ _capacity
◆ _data
template<typename Element>
|
protected |
◆ _increment
◆ _size
The documentation for this class was generated from the following file:
1.8.13