The OMStaticArray class contains basic library functions that enable you to create and manipulate OMStaticArray objects. An OMStaticArray is a type-safe, fixed-size array.
This class is defined in the header file omstatic.h.
count
This attribute specifies the number of elements in the static array. It is defined as follows:
int count;
theLink
This attribute specifies the link to an element in the static array. It is defined as follows:
void** theLink;
size
This attribute specifies the amount of memory allocated for the static array. It is defined as follows:
int size;
To use a static array, the multiplicity must be bounded (for example, MAX_OBSERVERS).
Consider the following example:
Observer* itsObserver[MAX_OBSERVERS];
for (int iter=0; iter<MAX_OBSERVERS; iter++)
{
if (itsObserver[iter] != NULL)
itsObserver[iter]->notify();
}