Rudiments
|
#include <staticarray.h>
Inherits arraycollection< valuetype >.
The staticarray class allows you to store a pre-defined number of values and access them with array-like syntax.
"valuetype" can be any scalar type, including a pointer, but cannot be an array.
Ie. these are legal: staticarray<int,10> d; staticarray<myclass,10> d; staticarray<myclass *,10> d;
These are not legal and whether they work or even compile would be platform-dependent: staticarray<int[100],10> d; staticarray<myclass[100],10> d; staticarray<myclass *[100],10> d;
However, it is possible to create an array of arrays by nesting staticarrays or dynamicarrays, like:
staticarray<staticarray<in >,10> d; staticarray<staticarray<myclass>,10> d; staticarray<staticarray<myclass *>,10> d; staticarray<dynamicarray<int>,10> d; staticarray<dynamicarray<myclass>,10> d; staticarray<dynamicarray<myclass *>,10> d;
NOTE: If "valuetype" is a pointer and either of collection::setManageValues(true) or collection::setManageArrayValue(true) are called, then all elements of the staticarray must be set to something.
For example, if the staticarray has count 10 then elements 0-9 must be set to some value. They may be set to 0 or NULL, but they must be set.
Otherwise attempts to delete the uninitialized elements during calls to clear() or the destructor will likely cause the program to crash.
|
inline |
Creates an empty instance of the staticarray class with "count" elements. "count" is given in the template definition.
|
inline |
Creates an instance of the staticarray class that is a copy of "v".
|
inline |
Creates an instance of the staticarray class that is a copy of "v".
|
inline |
Deletes this instance of the staticarray class.
|
inlinevirtual |
Clears the array. Always returns true.
Implements collection.
|
inlinevirtual |
Returns the number of elements in the array.
Implements collection.
|
inline |
Makes this instance of the staticarray class identical to "v".
|
inline |
Makes this instance of the staticarray class identical to "v".
|
inlinevirtual |
Provides read/write access to the "index"th element of the staticarray.
Implements arraycollection< valuetype >.
|
inline |
Sets all bytes of all elements of the staticarray to "value".
|
inline |
Sets all bytes of the first "setcount" elements of the dynamicarray to "value".
|
inline |
Sets all bytes of "setcount" elements of the dynamicarray, starting at "start", to "value".
|
inline |
Sets all bytes of all elements of the staticcarray to 0.
|
inline |
Sets all bytes of "zerocount" elements of the dynamicarray, starting at "start", to 0.
|
inline |
Sets all bytes of the first "zerocount" elements of the dynamicarray to 0.