Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::FixedSizeArray< Arr, sz > Class Template Reference
[Math]

A template class that allows the creation of specific type arrays with a defined fixed size. More...

#include <Vector.h>

Inheritance diagram for OSCAR::FixedSizeArray< Arr, sz >:

Inheritance graph
[legend]
List of all members.

Public Methods

 FixedSizeArray ()
 FixedSizeArray (const FixedSizeArray &fa)
FixedSizeArray & operator= (const FixedSizeArray< Arr, sz > &fa)

Private Methods

bool Grow (unsigned int growth)

Detailed Description

template<class Arr, unsigned int sz>
class OSCAR::FixedSizeArray< Arr, sz >

Author:
Chetan Kapoor
FixedSizeArray is a template class for creating arrays of a defined fixed size. Ideally, this class should use static memory allocation as done in FixedSizeMatrix. However, as VC 6.0 does not allow template-template arguments, and as such there is no simple way of specifying the Type of the FixedSizeArray. As such, the memory allocation of the parent class (using new is used).

Todo:
Change memory allocation to static once template-template arguments are supported
See also:
FixedSizeMatrix


Constructor & Destructor Documentation

template<class Arr, unsigned int sz>
OSCAR::FixedSizeArray< Arr, sz >::FixedSizeArray   [inline]
 

Constructor.

Default behavior: creates an array with elements initialized to zero or null based on type of array

template<class Arr, unsigned int sz>
OSCAR::FixedSizeArray< Arr, sz >::FixedSizeArray const FixedSizeArray< Arr, sz > &    fa [inline]
 

Copy Constructor. Creates an array with element initlized based on the parameter.

Parameters:
fa An FixedSizeArray of size sz (specified as template arguments).


Member Function Documentation

template<class Arr, unsigned int sz>
bool OSCAR::FixedSizeArray< Arr, sz >::Grow unsigned int    growth [inline, private]
 

Allocate more space. This method is disabled for RRFixedSizeVector's.

This method is used to increase the size(number of elements) in an Array object.

Parameters:
growth The number of elements by which the Array should grow.
Returns:
true if successful and false if not.

template<class Arr, unsigned int sz>
FixedSizeArray& OSCAR::FixedSizeArray< Arr, sz >::operator= const FixedSizeArray< Arr, sz > &    fa [inline]
 

Assignment operator.

Copies elements from a FixedSizeArray into another FixedSizeArray.

Parameters:
fa An FixedSizeArray of size sz (specified as template arguments).
Returns:
A reference to the object on the left hand side of the = operator.


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations