This is a template class which implements a simple associative array.
A NameList consists of N items, where each item has a name, an index,
and an associated data value (the type of which is determined by the type
given to the template).
int num(void) - return number of items in the NameList.
int add_name(char *, const T&) - adds a new name to the
list, with the given data of type T associated with it. This returns the
index (also called typecode) of the name in the list. If the name
already exists in the list, this just returns to index of the existing
name, and does not change the data stored.
char *name(int) - return the name of the Nth item.
char *sort_name(int) - return the name of the Nth sorted item,
i.e. the Nth highest name when they are put in sorted order.
int typecode(char *, int = -1) - return the index for the given
name. If the second argument is greater than 0, it is used as the max
length of the names to check for a match. If it is negative, an exact
match must be found. If no match is found, this returns -1.
int sort_typecode(int) - return the actual index of the Nth
sorted item.
T data(char *, int = -1) - return a copy of the data for
the given name, in the same way as for typecode(char *, int).
T data(int) - return the data for the Nth item.
void set_data(int, const T&) - changes the data value
associated with the Nth name to the given value.
This is a template used to associate sets of data of any type with character
strings (names). Names and data are added with add_name, and
the other routines are used to query info about these names. Many objects
in VMD use NameLists, for example the colors are all stored this way.