ovector_tlate Class Template Reference

#include <ovector_tlate.h>

Inheritance diagram for ovector_tlate:

ovector_view_tlate ofvector

Detailed Description

template<class data_t, class vparent_t, class block_t>
class ovector_tlate< data_t, vparent_t, block_t >

A vector with finite stride.

There are several global binary operators associated with objects of type uvector_tlate. The are documented in the "Functions" section of ovector_tlate.h.

Definition at line 541 of file ovector_tlate.h.


Public Member Functions

Standard constructor
 ovector_tlate (size_t n=0)
 Create an ovector of size n with owner as 'true'.
Copy constructors
 ovector_tlate (const ovector_tlate &v)
 Deep copy constructor, allocate new space and make a copy.
 ovector_tlate (const ovector_view_tlate< data_t, vparent_t, block_t > &v)
 Deep copy constructor, allocate new space and make a copy.
 ovector_tlate (const uvector_view_tlate< data_t > &v)
 Deep copy constructor, allocate new space and make a copy.
ovector_tlateoperator= (const ovector_tlate &v)
 Deep copy constructor, if owner is true, allocate space and make a new copy, otherwise, just copy into the view.
ovector_tlateoperator= (const ovector_view_tlate< data_t, vparent_t, block_t > &v)
 Deep copy constructor, if owner is true, allocate space and make a new copy, otherwise, just copy into the view.
ovector_tlateoperator= (const uvector_view_tlate< data_t > &v)
 Deep copy constructor, if owner is true, allocate space and make a new copy, otherwise, just copy into the view.
Memory allocation
int allocate (size_t nsize)
 Allocate memory for size n after freeing any memory presently in use.
int free ()
 Free the memory.
Stack-like operations (very experimental)
int push_back (data_t val)
 Add a value to the end of the vector.
int reserve (size_t cap)
 Reserve memory by increasing capacity.
data_t pop ()
 Return the last value and shrink the vector size by one.
Other methods
int erase (size_t ix)

Member Function Documentation

int free (  )  [inline]

Free the memory.

This function will safely do nothing if used without first allocating memory or if called multiple times in succession.

Definition at line 844 of file ovector_tlate.h.

int reserve ( size_t  cap  )  [inline]

Reserve memory by increasing capacity.

Increase the maximum capacity of the vector so that calls to push_back() do not need to automatically increase the capacity.

This function quietly does nothing if cap is smaller than the present vector size given by size().

Definition at line 926 of file ovector_tlate.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page