Go to the previous, next section.

CNArrayObject -- Array of Pointer to CNObject

SYNOPSIS

#include <CNCL/ArrayObject.h>

TYPE

CN_ARRAYOBJECT

BASE CLASSES

CNArray

DERIVED CLASSES

None

RELATED CLASSES

CNArrayChar, CNArrayDouble, CNArrayFLoat, CNArrayInt, CNArrayLong

DESCRIPTION

CNArrayObject manages arrays of pointers to CNObject.

Constructors:

CNArrayObject();
CNArrayObject(Param *param);
CNArrayObject(size_t sz, CNObjPtr def=0);
Initializes the array and optionally sets array size to sz. All element pointers are initialized to NIL or to def.

CNArrayObject(const CNArrayObject &a);
Copy constructor.

Destructors:

~CNArrayObject();
Deletes the array. The referenced objects are NOT deleted!

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

typedef CNObject *CNObjPtr;

virtual void size(size_t sz = 0 );
Sets the size of the array.

void put (int index, CNObjPtr value);
Puts value into array at indexed location.

CNObjPtr get (int index) const;
Returns value of array at indexed location.

CNObjPtr& operator[] (int index);
Access to array by operator [].

CNArrayObject &operator= (const CNArrayObject &a);
Defines the operator = for the array to allow copying of arrays.

Go to the previous, next section.