Dillo
|
Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector. More...
#include <misc.hh>
Public Member Functions | |
SimpleVector (int initAlloc=1) | |
SimpleVector (const SimpleVector &o) | |
~SimpleVector () | |
int | size () const |
Return the number of elements put into this vector. More... | |
bool | empty () const |
T * | getArray () const |
T * | detachArray () |
void | increase () |
Increase the vector size by one. More... | |
void | setSize (int newSize) |
Set the size explicitly. More... | |
void | setSize (int newSize, T t) |
Set the size explicitly and initialize new values. More... | |
T * | getRef (int i) const |
Return the reference of one element. More... | |
T | get (int i) const |
Return the one element, explicitly. More... | |
T * | getFirstRef () const |
Return the reference of the first element (convenience method). More... | |
T | getFirst () const |
Return the first element, explicitly. More... | |
T * | getLastRef () const |
Return the reference of the last element (convenience method). More... | |
T | getLast () const |
Return the last element, explicitly. More... | |
void | set (int i, T t) |
Store an object in the vector. More... | |
void | setLast (T t) |
Store an object at the end of the vector. More... | |
void | copyTo (SimpleVector< T > *dest, int thisStart=0, int thisLast=-1, int destStart=0) |
Copies some elements into another vector of the same type. More... | |
Private Member Functions | |
void | resize () |
Private Attributes | |
T * | array |
int | num |
int | numAlloc |
Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector.
|
inline |
|
inline |
|
inline |
|
inline |
Copies some elements into another vector of the same type.
Cannot be used to copy elements within one vector. (For this, it would have to be extended to copy backwards in some cases.)
|
inline |
Referenced by dw::Hyphenator::hyphenateWord(), and dw::Trie::load().
|
inline |
|
inline |
Return the one element, explicitly.
The element is copied, so for complex elements, you should rather used misc::SimpleVector::getRef.
Referenced by dw::Table::actuallyCalcCellSizes(), dw::Table::calcAdjustmentWidthSpanMultiCols(), dw::Table::calcExtremesSpanMultiCols(), dw::Table::childDefined(), lout::misc::SimpleVector< dw::Trie::TrieNode >::copyTo(), dw::Table::forceCalcCellSizes(), dw::Table::forceCalcColumnExtremes(), dw::AlignedTextblock::List::getTextblock(), dw::AlignedTextblock::List::getValue(), dw::Hyphenator::hyphenateSingleWord(), dw::Table::setCumHeight(), lout::misc::ZoneAllocator::zoneAlloc(), and lout::misc::ZoneAllocator::zoneFree().
|
inline |
Referenced by dw::Hyphenator::insertPattern().
|
inline |
Return the first element, explicitly.
|
inline |
Return the reference of the first element (convenience method).
|
inline |
Return the last element, explicitly.
|
inline |
Return the reference of the last element (convenience method).
Referenced by dw::Textblock::calcPenaltyIndexForNewLine(), and dw::Trie::load().
|
inline |
Return the reference of one element.
Referenced by dw::Textblock::lineYOffsetCanvas(), and dw::Textblock::lineYOffsetWidget().
|
inline |
Increase the vector size by one.
May be necessary before calling misc::SimpleVector::set.
Referenced by dw::Table::forceCalcColumnExtremes(), dw::Hyphenator::hyphenateSingleWord(), dw::Trie::load(), and lout::misc::ZoneAllocator::zoneAlloc().
|
inlineprivate |
|
inline |
Store an object in the vector.
Unlike in container::untyped::Vector and container::typed::Vector, you have to care about the size, so a call to misc::SimpleVector::increase or misc::SimpleVector::setSize may be necessary before.
Referenced by dw::Table::actuallyCalcCellSizes(), dw::Table::apportion2(), lout::misc::SimpleVector< dw::Trie::TrieNode >::copyTo(), dw::Hyphenator::hyphenateSingleWord(), dw::Hyphenator::insertPattern(), dw::Table::setCumHeight(), lout::misc::SimpleVector< dw::Trie::TrieNode >::setSize(), dw::AlignedTextblock::List::setValue(), and lout::misc::ZoneAllocator::zoneAlloc().
|
inline |
Store an object at the end of the vector.
Referenced by dw::Table::forceCalcColumnExtremes().
|
inline |
Set the size explicitly.
May be necessary before calling misc::SimpleVector::set.
Referenced by dw::Table::actuallyCalcCellSizes(), dw::Table::apportion2(), dw::Table::forceCalcCellSizes(), dw::Hyphenator::hyphenateSingleWord(), lout::misc::SimpleVector< dw::Trie::TrieNode >::increase(), dw::Hyphenator::insertPattern(), lout::misc::SimpleVector< dw::Trie::TrieNode >::setSize(), and lout::misc::ZoneAllocator::zoneFree().
|
inline |
Set the size explicitly and initialize new values.
May be necessary before calling misc::SimpleVector::set.
|
inline |
Return the number of elements put into this vector.
Referenced by dw::Table::actuallyCalcCellSizes(), dw::Textblock::calcPenaltyIndexForNewLine(), dw::Table::childDefined(), lout::misc::SimpleVector< dw::Trie::TrieNode >::copyTo(), lout::misc::SimpleVector< dw::Trie::TrieNode >::empty(), dw::Table::forceCalcColumnExtremes(), dw::Hyphenator::hyphenateSingleWord(), dw::Hyphenator::hyphenateWord(), dw::Trie::load(), dw::AlignedTextblock::List::size(), dw::Textblock::Textblock(), lout::misc::ZoneAllocator::zoneAlloc(), and lout::misc::ZoneAllocator::zoneFree().
|
private |
|
private |
|
private |