Dillo v3.1.1-98-g318d1f14
|
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. | |
bool | empty () const |
T * | getArray () const |
T * | detachArray () |
void | increase () |
Increase the vector size by one. | |
void | setSize (int newSize) |
Set the size explicitly. | |
void | setSize (int newSize, T t) |
Set the size explicitly and initialize new values. | |
T * | getRef (int i) const |
Return the reference of one element. | |
T | get (int i) const |
Return the one element, explicitly. | |
T * | getFirstRef () const |
Return the reference of the first element (convenience method). | |
T | getFirst () const |
Return the first element, explicitly. | |
T * | getLastRef () const |
Return the reference of the last element (convenience method). | |
T | getLast () const |
Return the last element, explicitly. | |
void | set (int i, T t) |
Store an object in the vector. | |
void | setLast (T t) |
Store an object at the end of the vector. | |
void | copyTo (SimpleVector< T > *dest, int thisStart=0, int thisLast=-1, int destStart=0) |
Copies some elements into another vector of the same type. | |
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 |
Definition at line 145 of file misc.hh.
References lout::misc::SimpleVector< T >::array, lout::misc::SimpleVector< T >::num, lout::misc::SimpleVector< T >::numAlloc, and lout::misc::SimpleVector< T >::resize().
|
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.)
Definition at line 287 of file misc.hh.
References lout::misc::SimpleVector< T >::get(), lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::size().
Referenced by dw::Table::forceCalcCellSizes().
|
inline |
Definition at line 168 of file misc.hh.
References lout::misc::SimpleVector< T >::array, lout::misc::SimpleVector< T >::num, and lout::misc::SimpleVector< T >::numAlloc.
Referenced by dw::Hyphenator::hyphenateWord(), and dw::Trie::load().
|
inline |
Definition at line 164 of file misc.hh.
References lout::misc::SimpleVector< T >::size().
|
inline |
Return the one element, explicitly.
The element is copied, so for complex elements, you should rather used misc::SimpleVector::getRef.
Definition at line 222 of file misc.hh.
Referenced by a_Menu_page_popup(), dw::Table::actuallyCalcCellSizes(), CssStyleSheet::addRule(), CssStyleSheet::apply(), dw::Table::apportionRowSpan(), dw::Table::calcAdjustmentWidthSpanMultiCols(), dw::Table::calcAvailWidthForDescendant(), dw::Table::calcExtremesSpanMultiCols(), lout::misc::SimpleVector< T >::copyTo(), dw::Table::drawLevel(), DilloHtml::HtmlLinkReceiver::enter(), dw::Table::forceCalcCellSizes(), dw::Table::forceCalcColumnExtremes(), DilloHtml::getCurrentForm(), dw::AlignedTextblock::List::getValue(), Html_contains_form(), Html_get_current_input(), Html_get_radio_input(), Html_set_link_coordinates(), Html_tag_close_head(), Html_tag_close_map(), Html_tag_content_area(), dw::Hyphenator::hyphenateSingleWord(), DilloHtml::loadImages(), CssSimpleSelector::match(), CssParser::parseRuleset(), CssSimpleSelector::print(), dw::Table::reallocChildren(), dw::Table::setCumHeight(), dw::Table::sizeAllocateImpl(), dw::Table::sizeRequestSimpl(), DilloHtml::unloadedImages(), lout::misc::ZoneAllocator::zoneAlloc(), lout::misc::ZoneAllocator::zoneFree(), CssSimpleSelector::~CssSimpleSelector(), DilloHtml::~DilloHtml(), and DoctreeNode::~DoctreeNode().
|
inline |
Definition at line 166 of file misc.hh.
References lout::misc::SimpleVector< T >::array.
Referenced by dw::Hyphenator::insertPattern().
|
inline |
|
inline |
Return the reference of the first element (convenience method).
Definition at line 230 of file misc.hh.
References lout::misc::SimpleVector< T >::array.
|
inline |
|
inline |
Return the reference of the last element (convenience method).
Definition at line 246 of file misc.hh.
Referenced by dw::Trie::load().
|
inline |
Return the reference of one element.
Definition at line 211 of file misc.hh.
References lout::misc::SimpleVector< T >::array.
Referenced by StyleEngine::apply(), DilloHtml::DilloHtml(), DilloHtml::finishParsing(), Html_display_listitem(), Html_push_tag(), Html_stack_cleanup_at_open(), Html_table_get_border_model(), Html_table_set_border_model(), Html_tag_cleanup_at_close(), Html_tag_open_li(), StyleEngine::inheritBackgroundColor(), DilloHtml::initDw(), CssSelector::match(), and StyleEngine::style0().
|
inline |
Increase the vector size by one.
May be necessary before calling misc::SimpleVector::set.
Definition at line 181 of file misc.hh.
References lout::misc::SimpleVector< T >::setSize().
Referenced by a_Html_image_new(), dw::Table::actuallyCalcCellSizes(), DilloHtml::addCssUrl(), DilloHtml::DilloHtml(), dw::Table::forceCalcColumnExtremes(), DilloHtml::formNew(), Html_add_input(), Html_push_tag(), Html_read_coords(), Html_set_new_link(), dw::Hyphenator::hyphenateSingleWord(), dw::Trie::load(), CssParser::parseRuleset(), CssSimpleSelector::setSelect(), splitStr(), and lout::misc::ZoneAllocator::zoneAlloc().
|
inlineprivate |
Definition at line 120 of file misc.hh.
References lout::misc::SimpleVector< T >::array, and lout::misc::SimpleVector< T >::num.
Referenced by lout::misc::SimpleVector< T >::setSize(), and lout::misc::SimpleVector< T >::SimpleVector().
|
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.
Definition at line 267 of file misc.hh.
Referenced by a_Html_image_new(), dw::Table::actuallyCalcCellSizes(), DilloHtml::addCssUrl(), dw::Table::apportion2(), lout::misc::SimpleVector< T >::copyTo(), dw::Table::forceCalcColumnExtremes(), DilloHtml::formNew(), Html_add_input(), Html_read_coords(), Html_set_new_link(), dw::Hyphenator::hyphenateSingleWord(), dw::Hyphenator::insertPattern(), CssParser::parseRuleset(), dw::Table::setCumHeight(), CssSimpleSelector::setSelect(), lout::misc::SimpleVector< T >::setSize(), dw::AlignedTextblock::List::setValue(), splitStr(), and lout::misc::ZoneAllocator::zoneAlloc().
|
inline |
Store an object at the end of the vector.
Definition at line 275 of file misc.hh.
Referenced by dw::Table::forceCalcColumnExtremes().
|
inline |
Set the size explicitly.
May be necessary before calling misc::SimpleVector::set.
Definition at line 188 of file misc.hh.
References lout::misc::SimpleVector< T >::resize().
Referenced by dw::Table::actuallyCalcCellSizes(), dw::Table::apportion2(), dw::Table::forceCalcColumnExtremes(), Html_real_pop_tag(), dw::Hyphenator::hyphenateSingleWord(), lout::misc::SimpleVector< T >::increase(), dw::Hyphenator::insertPattern(), dw::Table::reallocChildren(), lout::misc::SimpleVector< T >::setSize(), and lout::misc::ZoneAllocator::zoneFree().
|
inline |
Set the size explicitly and initialize new values.
May be necessary before calling misc::SimpleVector::set.
Definition at line 199 of file misc.hh.
References lout::misc::SimpleVector< T >::num, lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::setSize().
|
inline |
Return the number of elements put into this vector.
Definition at line 162 of file misc.hh.
References lout::misc::SimpleVector< T >::num.
Referenced by a_Html_common_image_attrs(), a_Html_image_new(), a_Menu_page_popup(), dw::Table::actuallyCalcCellSizes(), DilloHtml::addCssUrl(), CssStyleSheet::addRule(), CssContext::addRule(), CssStyleSheet::apply(), StyleEngine::apply(), dw::Table::apportionRowSpan(), lout::misc::SimpleVector< T >::copyTo(), lout::misc::SimpleVector< T >::empty(), DilloHtml::finishParsing(), dw::Table::forceCalcCellSizes(), dw::Table::forceCalcColumnExtremes(), DilloHtml::formNew(), DilloHtml::getCurrentForm(), Html_add_input(), Html_contains_form(), Html_display_listitem(), Html_get_current_input(), Html_get_radio_input(), Html_process_tag(), Html_push_tag(), Html_read_coords(), Html_real_pop_tag(), Html_set_new_link(), Html_stack_cleanup_at_open(), Html_table_get_border_model(), Html_table_set_border_model(), Html_tag_cleanup_at_close(), Html_tag_cleanup_to_idx(), Html_tag_close_head(), Html_tag_close_map(), Html_tag_content_area(), Html_tag_open_li(), Html_test_section(), dw::Hyphenator::hyphenateSingleWord(), dw::Hyphenator::hyphenateWord(), dw::Trie::load(), DilloHtml::loadImages(), CssSimpleSelector::match(), CssParser::parseRuleset(), CssSimpleSelector::print(), dw::Table::reallocChildren(), CssSimpleSelector::setSelect(), CssSimpleSelector::specificity(), splitStr(), DilloHtml::unloadedImages(), lout::misc::ZoneAllocator::zoneAlloc(), lout::misc::ZoneAllocator::zoneFree(), CssSimpleSelector::~CssSimpleSelector(), DilloHtml::~DilloHtml(), and DoctreeNode::~DoctreeNode().
|
private |
Definition at line 117 of file misc.hh.
Referenced by lout::misc::SimpleVector< T >::detachArray(), lout::misc::SimpleVector< T >::getArray(), lout::misc::SimpleVector< T >::getFirstRef(), lout::misc::SimpleVector< T >::getRef(), lout::misc::SimpleVector< T >::resize(), and lout::misc::SimpleVector< T >::SimpleVector().
|
private |
Definition at line 118 of file misc.hh.
Referenced by lout::misc::SimpleVector< T >::detachArray(), lout::misc::SimpleVector< T >::resize(), lout::misc::SimpleVector< T >::setSize(), lout::misc::SimpleVector< T >::SimpleVector(), and lout::misc::SimpleVector< T >::size().
|
private |
Definition at line 118 of file misc.hh.
Referenced by lout::misc::SimpleVector< T >::detachArray(), and lout::misc::SimpleVector< T >::SimpleVector().