next up previous 264
Next: Getting Attribute Values
Up: An AST Object Primer
Previous: The Object Hierarchy


Displaying Objects

Let us now return to the ZoomMap that we created earlier ([*]) and examine what it's made of. There is a function for doing this, called astShow, which is provided mainly for looking at Objects while you are debugging programs.

If you consult the description of astShow in [*], you will find that it takes a pointer to an Object (of type AstObject$*$) as its argument. Although we have only a ZoomMap pointer available, this is not a problem. If you refer to the brief class hierarchy described above ([*]), you will see that a ZoomMap is an Object, albeit a specialised one, so it inherits the properties of all Objects and can be substituted wherever an Object is required. We can therefore pass our ZoomMap pointer directly to astShow, as follows:

astShow( zoommap );

The output from this will appear on the standard output stream and should look like the following:

Begin ZoomMap
   Nin = 2
IsA Mapping
   Zoom = 5
End ZoomMap

Here, the ``Begin'' and ``End'' lines mark the beginning and end of the ZoomMap, while the values 2 and 5 are simply the values we supplied to initialise it ([*]). These have been given simple names to make them easy to refer to.

The line in the middle which says ``IsA Mapping'' is a dividing line between the two values. It indicates that the ``Nin'' value is a property shared by all Mappings, so the ZoomMap has inherited this from its parent class (Mapping). The ``Zoom'' value, however, is specific to a ZoomMap and isn't shared by other kinds of Mappings.


next up previous 264
Next: Getting Attribute Values
Up: An AST Object Primer
Previous: The Object Hierarchy

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
25th February 2013
E-mail:starlink@jiscmail.ac.uk

Copyright (C) 2014 Science \& Technology Facilities Council