Remote Administration Daemon Developer Guide

Exit Print View

Updated: July 2014
 
 

Derived Types

In addition to the base types, rad supports several derived types.

An enumeration is a set of user-defined tokens. Like C enumerations, rad enumerations may have specific integer values associated with them. Unlike C enumerations, rad enumerations and integers are not interchangeable. Among other things, this aspect means that an enumeration data value may not take on values outside those defined by the enumeration, which precludes the common but questionable practice of using enumerated types for bitfield values.

An array is an ordered list of data items of a fixed type. Arrays do not have a predefined size.

A structure is a record consisting of a fixed set of typed, uniquely named fields. A field's type may be a base type or derived type, or even another structure type.

Derived types offer almost unlimited flexibility. However, one important constraint imposed on derived types is that recursive type references are prohibited. Thus, complex self-referencing data types, for example, linked lists or trees, must be communicated after being mapped into simpler forms.