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

Detailed Description

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

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

Constructor & Destructor Documentation

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

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

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

Member Function Documentation

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.)

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

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

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

Return the first element, explicitly.

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

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

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

Return the last element, explicitly.

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

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

Referenced by dw::Textblock::calcPenaltyIndexForNewLine(), and dw::Trie::load().

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

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

Store an object at the end of the vector.

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

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.

Member Data Documentation

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

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