A SERVICE OF

logo

Field Classes
189
csField
csField is the abstract class from which all of the other eld classes are derived. Because
it does not have a constructor, you cannot use it directly. See The csField Class on
page 5 for additional information on csField.
csFieldInfo
csFieldInfo maintains information about the elds of a class, including the string name,
integer id, default value, and storage offset from class instance, all of which you set in the
constructor:
csFieldInfo(const char *name, short id, char csContainer::*offset);
The class methods provide means of obtaining the argument values.
const char* getName();
short getId();
char csContainer::* getOffset();
csFieldInfo also provides methods that allow you to create an enumeration by pairing
an integer with a string, and to create an alias for the eld.
void addEnum(int e, const char *str);
void addAlias(const char *alias);
csMField
csMField is an abstract class containing some of the functionality common to arrays,
including a container object, an index, and a storage value, as dened by the constructor:
csMField(csContainer *p, short i);
The set and get methods in the class dene array-type functionality, including returning
an offset value in the array where Cosmo 3D starts reading the array. The stride function
allows you to step through the values in the array at increments of two or more values at
a time, for example, if the stride is two, Cosmo 3D uses every other value in the array.
The count and size methods set and return the number of elements in the object, such as
the number of values in an array, and the total number of elements allocated for the
object.