Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWTValSortedDlist<T,C,A>

Module:  Essential Tools Module   Group:  STL-based Collection


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tvsrtdli.h> 
RWTValSortedDlist<T,C,A> srtdlist;

Description

This class maintains an always-sorted collection of values, implemented as a doubly-linked list.

The value type must have operator== and operator< defined. This requirement is imposed by the Standard C++ Library.

Persistence

Isomorphic

Example

In this example, a sorted doubly-linked list of RWDates is exercised.

Program Output:

Related Classes

RWTValSortedVector<T> is an alternative always-sorted collections. RWTValDlist<T,A> is an unsorted doubly-linked list of values.

Class list<T,A<T> > is the C++-standard collection that serves as the underlying implementation for this class.

Public Typedefs

typedef list<T,A<T> > container_type; 
typedef typename container_type::const_iterator iterator;
typedef typename container_type::const_iterator
  const_iterator;
typedef typename container_type::size_type  size_type;
typedef T value_type; 
typedef T& reference; 
typedef const T&  const_reference; 

Public Constructors

RWTValSortedDlist<T,C,A>();
RWTValSortedDlist<T,C,A>(const list<T,A>& lst);
RWTValSortedDlist<T,C,A>(const RWTValSortedDlist<T,C,A>& rwlst);
RWTValSortedDlist<T,C,A>(size_type n, const T& val = T());
RWTValSortedDlist<T,C,A>(const T* first, const T* last);

Public Member Operators

RWTValSortedDlist<T,C,A>&
operator=(const RWTValSortedDlist<T,C,A>& lst); 
RWTValSortedDlist<T,C,A>&
operator=(const list<T,A>& lst);
bool
operator<(const RWTValSortedDlist<T,C,A>& lst) const; 
bool
operator<(const list<T,A>& lst) const;
bool
operator==(const RWTValSortedDlist<T,C,A>& lst) const; 
bool
operator==(const list<T>& lst) const;
const_reference
operator()(size_type i) const; 
const_reference
operator[](size_type i) const; 

Public Member Functions

void
apply(void (*fn)(const_reference,void*), void* d) const; 
const_reference
at(size_type i) const; 
iterator
begin();
const_iterator
begin() const;
void
clear();
bool
contains(const_reference a) const; 
bool
contains(bool (*fn)(const_reference,void*), void* d) const;
iterator
end();
const_iterator
end() const;
size_type
entries() const; 
bool
find(const_reference a, value_type& k) const; 
bool
find(bool (*fn)(const_reference,void*), void* d, 
value_type& k) const;
reference
first();
const_reference
first() const;
size_type
index(const_reference a) const; 
size_type
index(bool (*fn)(const_reference,void*), void* d) const;
size_type
insert(const list<T,A<T> >& a); 
bool
insert(const_reference a); 
bool
isEmpty() const; 
bool
isSorted() const; 
const_reference
last() const; 
size_type
merge(const RWTValSortedDlist&<T,C> dl); 
size_type
occurrencesOf(const_reference) const; 
size_type
occurrencesOf(bool (*fn)(const_reference,void*),
              void* d) const;
bool
remove(const_reference a); 
bool
remove(bool (*fn)(const_reference,void*), void* d); 
size_type
removeAll(const_reference a); 
size_type
removeAll(bool (*fn)(const_reference,void*), void* d);
T
removeAt(size_type i); 
T
removeFirst();
T
removeLast();
list<T,A<T> >&
std();
const list<T,A<T> >&
std() const;

Related Global Operators

RWvostream&
operator<<(RWvostream& strm, 
       const RWTValSortedDlist<T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTValSortedDlist<T,C,A>& coll);
RWvistream&
operator>>(RWvistream& strm, RWTValSortedDlist<T,C,A>& coll); 
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C,A>& coll);
RWvistream&
operator>>(RWvistream& strm, RWTValSortedDlist<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C,A>*& p);


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.