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

ListItem Class Reference

List item implementation. More...

#include <listItem.h>

Inheritance diagram for ListItem::

RefCount LI1 LI2 LI3 LI4 LI5 AllocArena AllocGlobalRef AllocInstance AllocObject AllocObjectMethod AllocObjectTrace AllocThreadMethod AllocThreadObject AllocThreadObjectMethod AllocThreadObjectTrace AllocThreadTrace AllocTrace Class ClassField CpuThreadMethod CpuThreadTrace CpuTrace GC GroupThread IProf::sID Method MonThreadMethod MonThreadTrace MonTrace ObjectTable Thread AllocInstance AllocObject AllocObjectMethod AllocObjectTrace AllocThreadMethod AllocThreadObject AllocThreadObjectMethod AllocThreadObjectTrace AllocThreadTrace AllocTrace Class CpuThreadMethod CpuThreadTrace CpuTrace Method MonThreadMethod MonThreadTrace MonTrace Thread AllocObjectMethod AllocObjectTrace AllocThreadMethod AllocThreadObject AllocThreadObjectMethod AllocThreadObjectTrace AllocThreadTrace CpuThreadMethod CpuThreadTrace MonThreadMethod MonThreadTrace Thread AllocThreadObjectMethod AllocThreadObjectTrace Thread Thread List of all members.

Public Methods

 ListItem ()
 Default constructor.

virtual ~ListItem ()
 Destructor.

ListItem * next () const
 Next item in the list. More...

ListItem * add (ListItem **list)
 Adds self to the head of list. More...

ListItem * remove ()
 Removes self from a list. More...


Private Attributes

ListItem * _next
 pointer to next ListItem object in the list.

ListItem * _prev
 pointer to previous ListItem object in the list.

ListItem ** _list
 pointer where pointer to head of list is stored.


Detailed Description

List item implementation.

This class implements one item of the list. In truth it implements the list itself. This class has all needed methods to make the useful list, a small problem is a head of list you must store somewhere and manage by yourself. Another problem: in the same list there can be items of different types, all inherited from ListItem class. There is no typechecking, too. It is better to use List template for list of items of concrete type. Direct descendants, same classes as ListItem class but with different names, are L1, LI2 etc. classes. They are usually used when inheriting a descendant from two or more ListItem classes (eg. if you want to use one object in two different lists).

See also:
Hash, List, RefCount
Author:
Marek Przeczek

Definition at line 56 of file listItem.h.


Member Function Documentation

ListItem * ListItem::add ListItem **    list
 

Adds self to the head of list.

Parameters:
list  pointer to pointer to head of list
Returns:
new head of list
See also:
remove()

Definition at line 37 of file listItem.cpp.

ListItem* ListItem::next   const [inline]
 

Next item in the list.

This method returns pointer to next ListItem object in the dynamic list or NULL.

Returns:
pointer to ListItem object

Definition at line 86 of file listItem.h.

ListItem * ListItem::remove  
 

Removes self from a list.

Returns:
pointer to next item in the list
See also:
add()

Definition at line 51 of file listItem.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 14:53:29 2002 for Java Profiler Dynamic Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001