Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

NameList Class Template Reference

Template class, stores a list of unique names indexed in the order they are added. For each name, which acts as a key, there is an associated integer value. NameList string lookups are accelerated through the use of an internal hash table. More...

#include <NameList.h>

List of all members.

Public Methods

 NameList (void)
virtual ~NameList (void)
int num (void) const
void clear (void)
int add_name (const char *nm, const T &val)
const char * name (int a) const
int typecode (const char *nm) const
data (const char *nm) const
data (int a) const
void set_data (int a, const T &val)
void set_name (int a, const char *nm)

Protected Attributes

int Num
 number of items in the list. More...

ResizeArray< char * > names
 array of pointers to the strings;. More...

ResizeArray< T > Data
 integer data for the items. More...

hash_t hash
 hash table used to accelerate finds etc. More...


Detailed Description

template<class T>
class NameList< T >

Template class, stores a list of unique names indexed in the order they are added. For each name, which acts as a key, there is an associated integer value. NameList string lookups are accelerated through the use of an internal hash table.

Definition at line 40 of file NameList.h.


Constructor & Destructor Documentation

template<class T>
NameList< T >::NameList void    [inline]
 

Definition at line 50 of file NameList.h.

template<class T>
virtual NameList< T >::~NameList void    [inline, virtual]
 

Definition at line 56 of file NameList.h.


Member Function Documentation

template<class T>
int NameList< T >::add_name const char *    nm,
const T &    val
[inline]
 

Definition at line 82 of file NameList.h.

Referenced by SymbolTable::add_cfunction, Scene::add_color_category, Scene::add_color_item, SymbolTable::add_keyword, SymbolTable::add_singleword, SymbolTable::add_stringfctn, MaterialList::delete_material, and VMDApp::remove_menu.

template<class T>
void NameList< T >::clear void    [inline]
 

Definition at line 67 of file NameList.h.

template<class T>
T NameList< T >::data int    a const [inline]
 

Definition at line 155 of file NameList.h.

template<class T>
T NameList< T >::data const char *    nm const [inline]
 

Definition at line 142 of file NameList.h.

Referenced by Scene::add_color_item, SymbolTable::add_keyword, SymbolTable::add_singleword, SymbolTable::add_stringfctn, BaseMolecule::beta, BaseMolecule::bondorders, BaseMolecule::bondtypes, Scene::category_item_index, Scene::category_item_name, Scene::category_item_value, BaseMolecule::charge, BaseMolecule::flags, GeometryList::geom_list, Scene::get_category_item, BaseMolecule::get_radii_minmax, BaseMolecule::mass, MaterialList::material, Scene::num_category_items, BaseMolecule::occupancy, BaseMolecule::radius, Scene::set_category_item, and PickModeList::set_pick_mode.

template<class T>
const char* NameList< T >::name int    a const [inline]
 

Definition at line 119 of file NameList.h.

Referenced by MoleculeList::add_color_names, Scene::category_name, Scene::color_name, FileRenderer::format, GeometryList::geom_list_name, and MaterialList::material_name.

template<class T>
int NameList< T >::num void    const [inline]
 

Definition at line 64 of file NameList.h.

Referenced by MoleculeList::add_color_names, MaterialList::delete_material, MaterialList::num, Scene::num_categories, GeometryList::num_lists, FileRenderer::numformats, and PickModeList::set_pick_mode.

template<class T>
void NameList< T >::set_data int    a,
const T &    val
[inline]
 

Definition at line 164 of file NameList.h.

Referenced by MoleculeList::add_color_names, SymbolTable::add_keyword, SymbolTable::add_singleword, SymbolTable::add_stringfctn, and Scene::set_category_item.

template<class T>
void NameList< T >::set_name int    a,
const char *    nm
[inline]
 

Definition at line 172 of file NameList.h.

template<class T>
int NameList< T >::typecode const char *    nm const [inline]
 

Definition at line 131 of file NameList.h.

Referenced by Scene::add_color_category, SymbolTable::add_keyword, SymbolTable::add_singleword, SymbolTable::add_stringfctn, Scene::category_index, Scene::color_index, AtomColor::find, SymbolTable::find_attribute, GeometryList::geom_list_index, MaterialList::material_index, and FileRenderer::set_format.


Member Data Documentation

template<class T>
ResizeArray<T> NameList::Data [protected]
 

integer data for the items.

Definition at line 44 of file NameList.h.

template<class T>
hash_t NameList::hash [protected]
 

hash table used to accelerate finds etc.

Definition at line 45 of file NameList.h.

template<class T>
ResizeArray<char *> NameList::names [protected]
 

array of pointers to the strings;.

Definition at line 43 of file NameList.h.

template<class T>
int NameList::Num [protected]
 

number of items in the list.

Definition at line 42 of file NameList.h.

Referenced by NameList< Material * >::add_name, NameList< Material * >::clear, NameList< Material * >::data, NameList< Material * >::name, NameList< Material * >::NameList, NameList< Material * >::num, NameList< Material * >::set_data, NameList< Material * >::set_name, and NameList< Material * >::~NameList.


The documentation for this class was generated from the following file:
Generated on Fri Dec 13 02:46:44 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002