You can use the astGetX family of functions (ยง4.5) to get a value for any ObjectObject attribute at any time, regardless of whether a value has previously been set for it. If no value has been set, the AST library will generate a suitable default value.
Often, the default value of an attribute will not simply be trivial (zero or blank) but may involve considerable processing to calculate. Wherever possible, defaults are designed to be real-life, sensible values that convey information about the state of the Object. In particular, they may often be based on the values of other attributes, so their values may change in response to changes in these other attributes. The ZoomMapZoomMap class that we have studied so far is a little too simple to show this behaviour, but we will meet it later on.
An attribute that returns a default value in this way is said to be un-set. Conversely, once an explicit value has been assigned to an attribute, it becomes set and will always return precisely that value, never a default.
The distinction between set and un-set attributes is important and affects the behaviour of several key routines in the AST library. You can test if an attribute is set using the function astTestastTest, which returns a boolean (integer) result, as in:
Once an attribute is set, you can return it to its un-set state using astClearastClear. The effect is as if it had never been set in the first place. For example:
would ensure that the default value of the ReportReport attribute is used subsequently.