next up previous 264
Next: Creating More Complex Mappings
Up: Compound Mappings (CmpMaps)
Previous: Combining Mappings in Parallel


The Component Mappings

A CmpMap does not store copies of its component Mappings, but simply holds pointers to them. In th example above ([*]), we were free to annul the individual Mapping pointers after creating the CmpMap because the pointers held internally by the CmpMap increased the reference count (RefCount attribute) of each component Mapping by one. The individual components are therefore not deleted by AST_ANNUL, but retained until the CmpMap itself is deleted and annuls the pointers it holds. Consistent use of AST_ANNUL ([*]) and/or pointer contexts ([*]) will therefore ensure that all Objects are deleted at the appropriate time.

Note that access to a CmpMap's component Mappings is not generally available unless pointers to them are retained when the CmpMap is created. If such pointers are retained, then subsequent modifications to the individual components can be used to indirectly modify the behaviour of the overall CmpMap.

There is an important exception to this, however, because a CmpMap retains a copy of the initial Invert flag settings of each of its components and uses these in order to ignore any subsequent external changes. This means that you may invert either component Mapping before inserting it into a CmpMap and need not worry if you un-invert it again later. The CmpMap's behaviour will not be affected by the later action.


next up previous 264
Next: Creating More Complex Mappings
Up: Compound Mappings (CmpMaps)
Previous: Combining Mappings in Parallel

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2009 Science \& Technology Facilities Council