Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

cMessageHeap Class Reference

#include <cmsgheap.h>

Inheritance diagram for cMessageHeap::

cObject List of all members.

Public Methods

Constructors, destructor, assignment
 cMessageHeap (const cMessageHeap &msgq)
 cMessageHeap (const char *name=NULL, int size=128)
virtual ~cMessageHeap ()
cMessageHeap& operator= (const cMessageHeap &msgqueue)
Redefined cObject member functions.
virtual const char* className () const
virtual cObjectdup () const
virtual void info (char *buf)
virtual const char* inspectorFactoryName () const
virtual void forEach (ForeachFunc f)
Container functions.
void insert (cMessage *event)
cMessagepeekFirst () const
cMessagegetFirst ()
cMessageget (cMessage *event)
void sort ()
void clear ()
int length () const
bool empty () const

Detailed Description

Stores future event set. The underlying data structure is heap; the array used to store the heap expands as needed.

See also:
cMessageHeapIterator


Constructor & Destructor Documentation

cMessageHeap::cMessageHeap ( const cMessageHeap & msgq )
 

Copy constructor.

cMessageHeap::cMessageHeap ( const char * name = NULL,
int size = 128 )
 

Constructor.

cMessageHeap::~cMessageHeap ( ) [virtual]
 

Destructor.


Member Function Documentation

const char * cMessageHeap::className ( ) const [inline, virtual]
 

Returns pointer to a string containing the class name, "cMessageHeap".

Reimplemented from cObject.

void cMessageHeap::clear ( )
 

Deletes all messages in the heap.

cObject * cMessageHeap::dup ( ) const [inline, virtual]
 

Creates and returns an exact copy of this object. See cObject for more details.

Reimplemented from cObject.

bool cMessageHeap::empty ( ) const [inline]
 

Returns true if the heap is empty.

void cMessageHeap::forEach ( ForeachFunc f ) [virtual]
 

Call the passed function for each contained object. See cObject for more details.

Reimplemented from cObject.

cMessage * cMessageHeap::get ( cMessage * event )
 

Remove and return the given message in the heap.

cMessage * cMessageHeap::getFirst ( )
 

Remove and return the first message in the heap (the one with the smallest timestamp.)

void cMessageHeap::info ( char * buf ) [virtual]
 

Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details.

Reimplemented from cObject.

void cMessageHeap::insert ( cMessage * event )
 

Insert a new message into the heap.

const char * cMessageHeap::inspectorFactoryName ( ) const [inline, virtual]
 

Returns the name of the inspector factory class associated with this class. See cObject for more details.

Reimplemented from cObject.

int cMessageHeap::length ( ) const [inline]
 

Returns the number of messages in the heap.

cMessageHeap & cMessageHeap::operator= ( const cMessageHeap & msgqueue )
 

Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details.

cMessage * cMessageHeap::peekFirst ( ) const
 

Peek the first message in the heap (the one with the smallest timestamp.)

void cMessageHeap::sort ( )
 

Sort the contents of the heap. This is only necessary if one wants to iterate through in the FES in strict timestamp order.


The documentation for this class was generated from the following file:
Generated at Sat May 4 15:45:50 2002 for OMNeT++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001