Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

DpListBin(Type) Class Reference

binary sorted list of class objects. More...

#include <DpListBin_Type.h>

List of all members.

Public Methods

 DpListBin(Type) (;) DpListBin(Type(const) DpListBin(Type) &list_)
 ~DpListBin(Type) (;) inline const DpListBin(Type) &operator=(const DpListBin(Type) &list_)
void add (const Type *item)
Type* remove (const long int id)
Type* remove (const Type *item)
int size () const
Type* getItem (const long int id) const
Type* getItemBefore (const long int id) const
Type* operator[] (const int i) const


Detailed Description

binary sorted list of class objects.

NAME: DpListBin(Type) - binary sorted list of class objects

DESCRIPTION:

This class implements a macro template for a binary sorted list of class objects. The classes that can be sorted must implement a member

   int getId() const;
which returns a unique identifier of the class. The parameter type ("Type") must be a class name and not a pointer.


Constructor & Destructor Documentation

DpListBin(Type)::DpListBin_Type ( ; ) const
 

DpListBin(Type)::~DpListBin(Type) ( ; ) const
 


Member Function Documentation

void DpListBin(Type)::add ( const Type * item )
 

add a new item to the list.

Type * DpListBin(Type)::getItem ( const long int id ) const [inline]
 

return a pointer to the item with the given id, or NULL if not found.

Type * DpListBin(Type)::getItemBefore ( const long int id ) const [inline]
 

return a pointer to the item in the list with the largest id, less then or equal to the given id, or NULL if not found.

Type * DpListBin(Type)::operator[] ( const int i ) const [inline]
 

Type * DpListBin(Type)::remove ( const Type * item ) [inline]
 

See documentation of one of the overloaded functions.

Type * DpListBin(Type)::remove ( const long int id )
 

One version removes the item with supplied id, the other version of this function removes a specified object from the list. A pointer to the removed item is returned from the function.

int DpListBin(Type)::size ( ) const [inline]
 

returns the number of items in the list.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.