Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | misc |
include "itemcontainer.g"
itemcontainer | Construct an itemcontainer |
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 |
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.
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: .()