Go to the first, previous, next, last section, table of contents.


CNArrayInt -- Array of Integer

SYNOPSIS

#include <CNCL/ArrayInt.h>

TYPE

CN_ARRAYINT

BASE CLASSES

CNArray

DERIVED CLASSES

None

RELATED CLASSES

CNArrayObject, CNArrayChar, CNArrayDouble, CNArrayFLoat, CNArrayLong

DESCRIPTION

CNArrayInt manages arrays of integer (the builtin type int). CNArrayInt is presented here as an example for all CNArray<type> classes. The interface is the same for all classes only considering the different data types.

Constructors:

CNArrayInt();
CNArrayInt(Param *param);
CNArrayInt(size_t sz, int def=0);
Initializes the array and optionally sets array size to sz. All elements are set to the default value def.
CNArrayInt(const CNArrayInt &a);
Copy constructor.

Destructors:

~CNArrayInt();
Deletes the array.

In addition to the member functions required by CNCL, CNArrayInt provides:

virtual void size(size_t sz = 0 );
Sets the size of the array.
void put (int index, int value);
Puts value into array at indexed location.
int get (int index) const;
Returns value of array at indexed location.
int& operator[] (int index);
Access to array by operator [].
CNArrayInt &operator= (const CNArrayInt &a);
Defines the operator = for the array to allow copying of arrays.


Go to the first, previous, next, last section, table of contents.