Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

indexed_list Class Reference

A list class which contains pairs of keys and values. More...

#include <common/suif_indexed_list.h>

List of all members.


Public Members

typedef list<pair> pair_list
typedef pair_list::iterator iterator
typedef pair_list::const_iterator const_iterator
typedef pair value_type
void push_back (const Domain &key,const Range &value)
push to end of list.

pair& back ()
return a reference to the last element
Warning:
behavior is undefined on an empty list.


iterator insert (const iterator& pos, const pair& x)
Insert after the iterator position.

void clear_list ()
Make the list empty.

iterator find (const Domain &key)
Find the entry with the given key. More...

const_iterator find (const Domain &key) const
int num_with_key (const Domain &key)
Find the number of entries with the given key.

iterator find (const Domain &key,int no)
Find the nth entry with a given key. More...

const_iterator find (const Domain &key,int no) const
bool is_member (const Domain &key) const
Return true if there is an entry with the given key.

Range remove (iterator iter)
Remove the value identified by the iterator.

bool remove (Domain &key)
Remove the first entry which matches the key. More...

iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
unsigned length () const
Return number of entries.

unsigned size () const
Return number of entries.

pair& operator[] (int i) const
Index operator
Warning:
- no bound check done.



Detailed Description

template<class Domain, class Range> class indexed_list

A list class which contains pairs of keys and values.

The values are ordered as a list unlike suif_hash_map.

Warning:
lookup is a serial search \see suif_hash_map

Member Typedef Documentation

template<class Domain, class Range>
typedef list<pair> indexed_list<Domain, Range>::pair_list

template<class Domain, class Range>
typedef pair_list::iterator indexed_list<Domain, Range>::iterator

template<class Domain, class Range>
typedef pair_list::const_iterator indexed_list<Domain, Range>::const_iterator

template<class Domain, class Range>
typedef pair indexed_list<Domain, Range>::value_type


Member Function Documentation

template<class Domain, class Range>
void indexed_list<Domain, Range>::push_back (const Domain & key, const Range & value)

push to end of list.

template<class Domain, class Range>
pair & indexed_list<Domain, Range>::back ()

return a reference to the last element

Warning:
behavior is undefined on an empty list.

template<class Domain, class Range>
iterator indexed_list<Domain, Range>::insert (const iterator & pos, const pair & x)

Insert after the iterator position.

template<class Domain, class Range>
void indexed_list<Domain, Range>::clear_list ()

Make the list empty.

template<class Domain, class Range>
iterator indexed_list<Domain, Range>::find (const Domain & key)

Find the entry with the given key.

Returns end() if none

template<class Domain, class Range>
const_iterator indexed_list<Domain, Range>::find (const Domain & key) const

template<class Domain, class Range>
int indexed_list<Domain, Range>::num_with_key (const Domain & key)

Find the number of entries with the given key.

template<class Domain, class Range>
iterator indexed_list<Domain, Range>::find (const Domain & key, int no)

Find the nth entry with a given key.

Warning:
The first entry is 1, not zero

template<class Domain, class Range>
const_iterator indexed_list<Domain, Range>::find (const Domain & key, int no) const

template<class Domain, class Range>
bool indexed_list<Domain, Range>::is_member (const Domain & key) const

Return true if there is an entry with the given key.

template<class Domain, class Range>
Range indexed_list<Domain, Range>::remove (iterator iter)

Remove the value identified by the iterator.

template<class Domain, class Range>
bool indexed_list<Domain, Range>::remove (Domain & key)

Remove the first entry which matches the key.

Return true if one was found

template<class Domain, class Range>
iterator indexed_list<Domain, Range>::begin ()

template<class Domain, class Range>
const_iterator indexed_list<Domain, Range>::begin () const

template<class Domain, class Range>
iterator indexed_list<Domain, Range>::end ()

template<class Domain, class Range>
const_iterator indexed_list<Domain, Range>::end () const

template<class Domain, class Range>
unsigned indexed_list<Domain, Range>::length () const

Return number of entries.

template<class Domain, class Range>
unsigned indexed_list<Domain, Range>::size () const

Return number of entries.

template<class Domain, class Range>
pair & indexed_list<Domain, Range>::operator[] (int i) const

Index operator

Warning:
- no bound check done.


The documentation for this class was generated from the following file:
Generated at Wed Apr 25 17:35:13 2001 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999