PPL Logo

EqHeap Class Reference

Heap structure to store events in unexecuted portion of event queue. More...

#include <eqheap.h>

Collaboration diagram for EqHeap:

Collaboration graph
[legend]

Public Member Functions

 EqHeap ()
 Basic Constructor.
 ~EqHeap ()
 Destructor.
int size ()
 Heap size.
void InsertEvent (Event *e)
 Insert event e in heap with low timestamps at top of heap.
void InsertDeterministic (Event *e)
 Insert event e in heap deterministically with low timestamps at top.
EventGetAndRemoveTopEvent ()
 Return event on top of heap, deleting it from the heap.
int DeleteEvent (eventID evID, POSE_TimeType timestamp)
 Delete event from heap.
POSE_TimeType FindMax ()
 Find maximum element.
void dump ()
 Dump entire heap.
char * dumpString ()
 Dump entire heap to a string.
void pup (PUP::er &p)
 Pack/unpack/sizing operator.
void sanitize ()
 Check validity of data fields.

Data Fields

HeapNodetop
 Top node of heap.

Private Attributes

int heapSize
 Size of heap.

Detailed Description

Heap structure to store events in unexecuted portion of event queue.

Definition at line 61 of file eqheap.h.


Constructor & Destructor Documentation

EqHeap::EqHeap (  )  [inline]

Basic Constructor.

Definition at line 68 of file eqheap.h.

EqHeap::~EqHeap (  )  [inline]

Destructor.

Definition at line 70 of file eqheap.h.

References top.


Member Function Documentation

int EqHeap::size ( void   )  [inline]

Heap size.

Definition at line 72 of file eqheap.h.

References heapSize.

void EqHeap::InsertEvent ( Event e  ) 

Insert event e in heap with low timestamps at top of heap.

Definition at line 253 of file eqheap.C.

References POSE_Config::deterministic, HeapNode::e, Event::evID, heapSize, HeapNode::insert(), InsertDeterministic(), HeapNode::left, pose_config, HeapNode::right, sanitize(), HeapNode::subheapsize, Event::timestamp, and top.

Referenced by eventQueue::InsertEvent(), eventQueue::InsertEventDeterministic(), and pup().

Here is the call graph for this function:

Here is the caller graph for this function:

void EqHeap::InsertDeterministic ( Event e  ) 

Insert event e in heap deterministically with low timestamps at top.

Insert event e in heap with low timestamps at top of heap.

Definition at line 309 of file eqheap.C.

References HeapNode::e, Event::evID, heapSize, HeapNode::insert(), HeapNode::left, HeapNode::right, sanitize(), HeapNode::subheapsize, Event::timestamp, and top.

Referenced by InsertEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Event * EqHeap::GetAndRemoveTopEvent (  ) 

Return event on top of heap, deleting it from the heap.

Returns event at top of heap if one exists, null otherwise; deletes top node in heap, conjoining left and right subheaps

Definition at line 361 of file eqheap.C.

References HeapNode::conjoin(), HeapNode::e, heapSize, HeapNode::left, HeapNode::right, sanitize(), HeapNode::subheapsize, and top.

Referenced by eventQueue::CommitEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

int EqHeap::DeleteEvent ( eventID  evID,
POSE_TimeType  timestamp 
)

Delete event from heap.

Delete the node with event corresponding to evID and timestamp; returns 1 if an event was successfully deleted, 0 if the event was not found in the heap

Definition at line 385 of file eqheap.C.

References HeapNode::conjoin(), HeapNode::e, Event::evID, heapSize, HeapNode::left, HeapNode::remove(), HeapNode::right, sanitize(), Event::timestamp, and top.

Referenced by con::CancelEvents(), and opt::Rollback().

Here is the call graph for this function:

Here is the caller graph for this function:

POSE_TimeType EqHeap::FindMax (  )  [inline]

Find maximum element.

Definition at line 87 of file eqheap.h.

References HeapNode::findMax(), POSE_UnsetTS, and top.

Here is the call graph for this function:

void EqHeap::dump (  ) 

Dump entire heap.

Definition at line 438 of file eqheap.C.

References HeapNode::dump(), and top.

Referenced by eventQueue::CommitEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

char * EqHeap::dumpString (  ) 

Dump entire heap to a string.

Definition at line 447 of file eqheap.C.

Referenced by eventQueue::CommitEvents().

Here is the caller graph for this function:

void EqHeap::pup ( PUP::er p  ) 

Pack/unpack/sizing operator.

Pups entire heap relying on recursive HeapNode::pup

Definition at line 417 of file eqheap.C.

References heapSize, InsertEvent(), PUP::er::isUnpacking(), p, HeapNode::pup(), Event::pup(), and top.

Referenced by eventQueue::CommitEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

void EqHeap::sanitize (  ) 

Check validity of data fields.

Definition at line 461 of file eqheap.C.

References heapSize, HeapNode::sanitize(), and top.

Referenced by eventQueue::CommitEvents(), DeleteEvent(), GetAndRemoveTopEvent(), InsertDeterministic(), and InsertEvent().

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

int EqHeap::heapSize [private]

Size of heap.

Definition at line 63 of file eqheap.h.

Referenced by DeleteEvent(), GetAndRemoveTopEvent(), InsertDeterministic(), InsertEvent(), pup(), sanitize(), and size().


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:23:17 2020 for Charm++ by  doxygen 1.5.5