Go::ScratchVect< T, N > Class Template Reference
['utils' - a collection of useful math and programming tools]

A template Vector class that behaves much like the std::vector template, but stores its elements on the stack rather than on the heap as long as the total size stays less than 'N' (template argument). More...

#include <ScratchVect.h>

List of all members.

Public Types

typedef T * iterator
typedef const T * const_iterator

Public Member Functions

 ScratchVect ()
 Create a new, empty ScratchVect.
 ScratchVect (size_t size)
 Create a new ScratchVect with 'size' (uninitialized) elements.
 ScratchVect (size_t size, T elem)
 Create a new ScratchVect with 'size' elements initialized to the value 'elem'.
 ScratchVect (const std::vector< T > &vec)
 Set the contents of this ScratchVect to be equal to that of the STL vector 'vec'.
template<typename RAIter>
 ScratchVect (RAIter beg, RAIter end)
 Set the contents of this ScratchVect to be equal to the contents of the range specified by 'beg' and 'end'.
template<int M>
 ScratchVect (const ScratchVect< T, M > &orig)
 Set the contents of this ScratchVector to be equal to that of the ScratchVector 'orig'.
ScratchVectoperator= (const ScratchVect &orig)
 Assignment operator.
void resize (size_t new_size)
 resize the ScratchVect
template<typename RAIter>
void assign (RAIter beg, RAIter end)
 Set the contents of this ScratchVect to be equal to the contents of the range specified by 'beg' and 'end'.
iterator begin ()
 Get iterator to beginning of range.
const_iterator begin () const
 Get constant iterator to beginning of range.
iterator end ()
 Get iterator to one-past-end of range.
const_iterator end () const
 Get constant iterator to one-past-end of range.
size_t size () const
 Get the number of elements in the ScratchVect.
const T & operator[] (int i) const
 Element access operators (const and not-const).
T & operator[] (int i)
void push_back (const T &e)
 Add an element to the back of the range.
void clear ()
 Clear ScratchVect.


Detailed Description

template<typename T, size_t N>
class Go::ScratchVect< T, N >

A template Vector class that behaves much like the std::vector template, but stores its elements on the stack rather than on the heap as long as the total size stays less than 'N' (template argument).

Definition at line 52 of file ScratchVect.h.


Constructor & Destructor Documentation

template<typename T, size_t N>
template<int M>
Go::ScratchVect< T, N >::ScratchVect ( const ScratchVect< T, M > &  orig  )  [inline]

Set the contents of this ScratchVector to be equal to that of the ScratchVector 'orig'.

(A templatized copy constructor, if you like).

Definition at line 115 of file ScratchVect.h.

References Go::ScratchVect< T, N >::assign(), Go::ScratchVect< T, N >::begin(), and Go::ScratchVect< T, N >::end().


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:19 2007 for GoTools Core Library by  doxygen 1.5.1