Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWTValVector<T>

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/tvvector.h>
RWTValVector<T> vec;

Descripton

Class RWTValVector<T> is a simple parameterized vector of objects of type T. It is most useful when you know precisely how many objects have to be held in the collection. If the intention is to "insert" an unknown number of objects into a collection, then class RWTValOrderedVector<T> may be a better choice.

The class T must have:

Persistence

Isomorphic

Example

#include <rw/tvvector.h>
#include <rw/rwdate.h>
#include <rw/rstream.h>

main()  {
  RWTValVector<RWDate> week(7);

  RWDate begin;   // Today's date

  for (int i=0; i<7; i++)
    week[i] = begin++;

  for (i=0; i<7; i++)
    cout << week[i] << endl;

  return 0;
}

Program output:

March 16, 1996
March 17, 1996
March 18, 1996
March 19, 1996
March 20, 1996
March 21, 1996
March 22, 1996

Public Constructors

RWTValVector<T>();
RWTValVector<T>(size_t n);
RWTValVector<T>(size_t n, const T& ival);
RWTValVector<T>(const RWTValVector& v);
~RWTValVector<T>();

Public Operators

RWTValVector<T>&
operator=(const RWTValVector<T>& v); 
RWTValVector<T>&
operator=(const T& ival);
const T&
operator()(size_t i) const; 
T&
operator()(size_t i);
const T&
operator[](size_t i) const; 
T&
operator[](size_t i);

Public Member Functions

const T*
data() const; 
size_t
length() const; 
void
reshape(size_t N); 


Previous fileTop of documentContentsIndexNext file
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.