Dillo v3.1.1-4-g5db6c990
Loading...
Searching...
No Matches
lout::misc::SimpleVector< T > Class Template Reference

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.
 
get (int i) const
 Return the one element, explicitly.
 
T * getFirstRef () const
 Return the reference of the first element (convenience method).
 
getFirst () const
 Return the first element, explicitly.
 
T * getLastRef () const
 Return the reference of the last element (convenience method).
 
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
 

Detailed Description

template<class T>
class lout::misc::SimpleVector< T >

Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector.

Definition at line 93 of file misc.hh.

Constructor & Destructor Documentation

◆ SimpleVector() [1/2]

template<class T >
lout::misc::SimpleVector< T >::SimpleVector ( int  initAlloc = 1)
inline

Definition at line 117 of file misc.hh.

◆ SimpleVector() [2/2]

◆ ~SimpleVector()

template<class T >
lout::misc::SimpleVector< T >::~SimpleVector ( )
inline

Definition at line 132 of file misc.hh.

Member Function Documentation

◆ copyTo()

template<class T >
void lout::misc::SimpleVector< T >::copyTo ( SimpleVector< T > *  dest,
int  thisStart = 0,
int  thisLast = -1,
int  destStart = 0 
)
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 266 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().

◆ detachArray()

template<class T >
T * lout::misc::SimpleVector< T >::detachArray ( )
inline

◆ empty()

template<class T >
bool lout::misc::SimpleVector< T >::empty ( ) const
inline

Definition at line 143 of file misc.hh.

References lout::misc::SimpleVector< T >::size().

◆ get()

◆ getArray()

template<class T >
T * lout::misc::SimpleVector< T >::getArray ( ) const
inline

Definition at line 145 of file misc.hh.

References lout::misc::SimpleVector< T >::array.

Referenced by dw::Hyphenator::insertPattern().

◆ getFirst()

template<class T >
T lout::misc::SimpleVector< T >::getFirst ( ) const
inline

Return the first element, explicitly.

Definition at line 217 of file misc.hh.

◆ getFirstRef()

template<class T >
T * lout::misc::SimpleVector< T >::getFirstRef ( ) const
inline

Return the reference of the first element (convenience method).

Definition at line 209 of file misc.hh.

References lout::misc::SimpleVector< T >::array.

◆ getLast()

template<class T >
T lout::misc::SimpleVector< T >::getLast ( ) const
inline

Return the last element, explicitly.

Definition at line 233 of file misc.hh.

◆ getLastRef()

template<class T >
T * lout::misc::SimpleVector< T >::getLastRef ( ) const
inline

Return the reference of the last element (convenience method).

Definition at line 225 of file misc.hh.

Referenced by dw::Trie::load().

◆ getRef()

◆ increase()

◆ resize()

template<class T >
void lout::misc::SimpleVector< T >::resize ( )
inlineprivate

◆ set()

◆ setLast()

template<class T >
void lout::misc::SimpleVector< T >::setLast ( t)
inline

Store an object at the end of the vector.

Definition at line 254 of file misc.hh.

Referenced by dw::Table::forceCalcColumnExtremes().

◆ setSize() [1/2]

◆ setSize() [2/2]

template<class T >
void lout::misc::SimpleVector< T >::setSize ( int  newSize,
t 
)
inline

Set the size explicitly and initialize new values.

May be necessary before calling misc::SimpleVector::set.

Definition at line 178 of file misc.hh.

References lout::misc::SimpleVector< T >::num, lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::setSize().

◆ size()

template<class T >
int lout::misc::SimpleVector< T >::size ( ) const
inline

Return the number of elements put into this vector.

Definition at line 141 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().

Member Data Documentation

◆ array

◆ num

◆ numAlloc

template<class T >
int lout::misc::SimpleVector< T >::numAlloc
private

The documentation for this class was generated from the following file: