Vary

Template class for treating a variable size array

[ libohymos | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION

Class Summary

template <class Type>
class Vary
{

public:
void Resize(int n);
Type Value(int i) const ;
int Size(void) const ;
Vary(void);
Vary(int n);
Vary(const Vary<Type>& a);
Vary<Type>& operator=(const Vary<Type>& a);
~Vary();
Type& operator[](int idx) ;
protected:
}; // Vary

Back to the top of Vary


DESCRIPTION

Class Vary< T> is a template class for treating an array of type T. The number of elements is also contained as its data member.

For example, the following line declares an array of type double with the size of 3,

      Vary<double> a(3);
      int n = a.Size(); // n = 3
      a[0] = 1.2;

Back to the top of Vary


void Resize(int n);

Changes the size to n

  void Resize(int n);

Back to the top of Vary


Type Value(int i) const ;

Returns the i-th component

  Type Value(int i) const                 
;

Function is currently defined inline.


Back to the top of Vary


int Size(void) const ;

return the size of the array

  int Size(void) const                 
;

Function is currently defined inline.


Back to the top of Vary


Vary(void);

constructor

  Vary(void);

Back to the top of Vary


Vary(int n);

constructor

  Vary(int n);

Back to the top of Vary


Vary(const Vary<Type>& a);

copy constructor

  Vary(const Vary<Type>& a);

Back to the top of Vary


Vary<Type>& operator=(const Vary<Type>& a);

substitution constructor

  Vary<Type>& operator=(const Vary<Type>& a);

Back to the top of Vary


~Vary();

destructor

  ~Vary();

Back to the top of Vary


Type& operator[](int idx) ;

you can use a[i] as a[i] = 3.

  Type& operator[](int idx)                   
;

Function is currently defined inline.


Back to the top of Vary


All Members

public:
void Resize(int n);
Type Value(int i) const ;
int Size(void) const ;
Vary<Type>& operator=(const Vary<Type>& a);
Type& operator[](int idx) ;
protected:

Back to the top of Vary


Ancestors

Class does not inherit from any other class.

Back to the top of Vary


Descendants

Class is not inherited by any others.

Back to the top of Vary


Generated from source by the Cocoon utilities on Sun Sep 3 22:52:08 2000 .

Report problems to jkotula@stratasys.com