In file IndexList.hh:

template<class T, class Cmp = IndexSort> class IndexList

Defines a list with a case-insensitive index

Inheritance:


Public Methods

[more] IndexList ()
Default constructor
[more] IndexList (const IndexList& index)
Copy constructor
[more]IndexList& operator= (const IndexList& index)
Assignment operator
[more]const base_list& List () const
Index
[more]typename base_list::iterator begin ()
begin
[more]const_iterator begin () const
begin
[more]typename base_list::iterator end ()
end
[more]const_iterator end () const
end
[more]const index_type& Index () const
Index
[more]T* Get (const char* s)
Get
[more]const T* Get (const char* s) const
Get
[more]typename base_list::iterator GetPos (const char* s)
Get position
[more]const_iterator GetPos (const char* s) const
Get position
[more]T& operator[] (int pos)
Element access
[more]const T& operator[] (int pos) const
Element access
[more]void Add (const T& el)
Add
[more]void Insert (const T& el)
Insert
[more]void Remove (typename base_list::iterator pos)
Remove
[more]void Remove (int pos)
Remove
[more]void Remove (const char* name)
Remove
[more]void Clear ()
Clear
[more]int Size () const
Size
[more]bool Empty () const
Empty?
[more]void Sort ()
Sort

Public Members

[more]typedef T element_type
Element type
[more]typedef std::vector<T> base_list
Base list
[more]typedef typename base_list::iterator iterator
Iterator
[more]typedef typename base_list::const_iterator const_iterator
Const Iterator
[more]typedef Cmp sort_order
Sort order
[more]typedef std::map<std::string, int, Cmp> index_type
Index list
[more]typedef typename index_type::iterator index_iterator
Index iterator
[more]typedef typename index_type::const_iterator const_index_iterator
Const index iterator

Protected Methods

[more]void AddToIndex (typename base_list::iterator pos)
Index add
[more]void RemoveFromIndex (typename base_list::iterator pos)
Index remove
[more]void RebuildIndex ()
Rebuild index
[more]void RebuildIndexAfterInsert (typename base_list::iterator pos)
Rebuild index after insert
[more]void RebuildIndexAfterRemove (typename base_list::iterator pos)
Rebuild index after remove


Documentation

Defines a list with a by default case-insensitive index.

otypedef T element_type
Element type

otypedef std::vector<T> base_list
Base list

otypedef typename base_list::iterator iterator
Iterator

otypedef typename base_list::const_iterator const_iterator
Const Iterator

otypedef Cmp sort_order
Sort order

otypedef std::map<std::string, int, Cmp> index_type
Index list

otypedef typename index_type::iterator index_iterator
Index iterator

otypedef typename index_type::const_iterator const_index_iterator
Const index iterator

o IndexList()
Creates an empty index list

o IndexList(const IndexList& index)
Copy constructor

oIndexList& operator= (const IndexList& index)
Assignment operator

oconst base_list& List() const
Return the list

otypename base_list::iterator begin()
Return the beginning of the list

oconst_iterator begin() const
Return the beginning of the list

otypename base_list::iterator end()
Return the end of the list

oconst_iterator end() const
Return the end of the list

oconst index_type& Index() const
Return the index

oT* Get(const char* s)
Get the element (uses the index)

oconst T* Get(const char* s) const
Get the element (uses the index)

otypename base_list::iterator GetPos(const char* s)
Get the element position (uses the index)

oconst_iterator GetPos(const char* s) const
Get the element position (uses the index)

oT& operator[] (int pos)
Element access by position

oconst T& operator[] (int pos) const
Element access by position

ovoid Add(const T& el)
Adds an element to the end of the list

ovoid Insert(const T& el)
Inserts an element

ovoid Remove(typename base_list::iterator pos)
Removes an element from the list

ovoid Remove(int pos)
Removes an element from the list

ovoid Remove(const char* name)
Removes an element from the list

ovoid Clear()
Clears the list

oint Size() const
Size of the list

obool Empty() const
Empty list?

ovoid Sort()
Sort the base list

ovoid AddToIndex(typename base_list::iterator pos)
Add an entry to the index

ovoid RemoveFromIndex(typename base_list::iterator pos)
Remove an entry from the index

ovoid RebuildIndex()
Rebuild index

ovoid RebuildIndexAfterInsert(typename base_list::iterator pos)
Rebuild index after insert

ovoid RebuildIndexAfterRemove(typename base_list::iterator pos)
Rebuild index after remove


This class has no child classes.
Author:
Written June 2001 by Masahiro Ito and Daniel Sigg
Version:
1.0

Alphabetic index HTML hierarchy of classes or Java


Please send questions and comments to zweizig_j@ligo-wa.caltech.edu