Array Storage Class Types
181
Array Classes
csArray is a virtual array class from which all other array classes are derived. Arrays are
used as storage vehicles for a variety of types. Cosmo 3D provides a wealth of
csArray-derived array classes for different types, including:
• csPtrArray—An array of pointers often used to point to values in other arrays.
• csFieldArray—An array of fields.
• csByteArray—An array of bytes.
• csIntArray—An array of integers.
• csFloatArray—An array of floats.
• csVec2fArray—An array of Vec2f classes.
• csVec3fArray—An array of Vec3f classes.
• csVec3sArray—An array of Vec3s classes.
• csVec4fArray—An array of Vec4f classes.
• csMatrix4fArray—An array of Matrix4f classes.
• csRotationArray—An array of rotation vectors.
• csStringArray—An array of strings.
• csShortArray—An array of shorts.
• csFieldInfoArray—An array of field descriptions.
• csRefArray—An array of pointers to containers.
• csEventArray—An array of events; an event is a user action, such as a mouse click.
The methods in all of the array classes are similar, as described in the following section.
Array Methods
The methods in csArray and all of the derived array classes are similar; the differences
stem from the different types filling the arrays. The following example explains the
methods in csIntArray but you can easily apply the same descriptions to all of the other
array classes.