Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: itemcontainer - Constructor Up: misc - Module Previous: substitute.substitutestring - Function


itemcontainer - Tool



Package utility
Module misc


Postscript file available

A generic closure toolcontainer

include "itemcontainer.g"

Constructors
itemcontainer Construct an itemcontainer
Functions
add Add the item to the container
delete Remove the item from the container
done Destroy this itemcontainer
fromrecord Add the fields of this record
get Recover value of specified item
has_item Does this item exist
length Returns the number of items
makeconst Make this itemcontainer const
makeunconst Make this itemcontainer unconst
names Returns list of item names
set Put the named item into the container
torecord Return the contents of the container as a record
type Return the type of this tool



Description

This generic closure tool is designed to be used as a container of small items. Once created, the container can be made immutable. There is functionality to put items into the container, remove them and recover the contents of the container. Items can be of any type, and different types can be mixed in the one container.

Region of interest tools are actually itemcomntainer tools.



Example

We make a tool containing some smoothing kernel information. After invoking the makeconst function, you can no longer add items to the container or delete from it.

- include 'itemcontainer.g';
T
- include 'quanta.g';
T
- kernelType := 'gaussian';
- kernelWidth := dq.quantity(20,'arcsec');
- const i1 := itemcontainer();
- i1.set('type', kernelType);
T
- i1.set('width', kernelWidth);
T
- i1.makeconst();
T
- i1.set('comment', 'fish');
<fail>: This is a const object, you cannot write to it
        File:   itemcontainer.g, Line 228
        Stack:  .()




next up previous contents index
Next: itemcontainer - Constructor Up: misc - Module Previous: substitute.substitutestring - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15