Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

cMessageHeap Class Reference
[Internal classes]

#include <cmsgheap.h>

Inheritance diagram for cMessageHeap:

cObject cPolymorphic List of all members.

Detailed Description

Stores future event set.

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

See also:
Iterator


Public Member Functions

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 cObject * dup () const
virtual std::string info () const
virtual void forEachChild (cVisitor *v)
Container functions.
void insert (cMessage *event)
cMessage * peekFirst () const
cMessage * getFirst ()
cMessage * get (cMessage *event)
void sort ()
void clear ()
int length () const
bool empty () const


Constructor & Destructor Documentation

cMessageHeap::cMessageHeap (  const cMessageHeap &  msgq  ) 
 

Copy constructor.

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

Constructor.

virtual cMessageHeap::~cMessageHeap (   )  [virtual]
 

Destructor.


Member Function Documentation

void cMessageHeap::clear (   ) 
 

Deletes all messages in the heap.

virtual 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.

virtual void cMessageHeap::forEachChild (  cVisitor *  v  )  [virtual]
 

Calls v->visit(this) for each contained object.

See cObject for more details.

Reimplemented from cObject.

cMessage* cMessageHeap::get (  cMessage *  event  ) 
 

Removes and returns the given message in the heap.

If the message is not in the heap, returns NULL.

cMessage* cMessageHeap::getFirst (   ) 
 

Removes and return the first message in the heap (the one with the smallest timestamp.) If the heap is empty, it returns NULL.

virtual std::string cMessageHeap::info (   )  const [virtual]
 

Produces a one-line description of object contents into the buffer passed as argument.

See cObject for more details.

Reimplemented from cPolymorphic.

void cMessageHeap::insert (  cMessage *  event  ) 
 

Insert a new message into the heap.

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.) If the heap is empty, it returns NULL.

void cMessageHeap::sort (   ) 
 

Sorts 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 on Fri Apr 1 12:25:34 2005 for OMNeT++/OMNEST Simulation Library by  doxygen 1.3.9.1