#include <eqheap.h>
Public Member Functions | |
HeapNode () | |
Basic Constructor. | |
HeapNode (Event *ev, int sz, HeapNode *l, HeapNode *r) | |
Initializing Constructor. | |
~HeapNode () | |
Destructor. | |
void | insert (Event *e) |
Insert event in heap. | |
void | insertDeterministic (Event *e) |
Insert event in heap deterministically. | |
HeapNode * | conjoin (HeapNode *h) |
Join this heap with h. | |
int | remove (eventID evID, POSE_TimeType timestamp) |
Remove heap node matching evID. | |
POSE_TimeType | findMax () |
Find maximum element. | |
void | dump () |
Dump all data fields. | |
char * | dumpString () |
Dump all data fields to a string. | |
void | pup (PUP::er &p) |
Pack/unpack/sizing operator. | |
void | sanitize () |
Check validity of data fields. | |
Data Fields | |
int | subheapsize |
Size of subheap topped by this node. | |
Event * | e |
The event stored here. | |
HeapNode * | left |
Left and right subheaps. | |
HeapNode * | right |
Definition at line 8 of file eqheap.h.
HeapNode::HeapNode | ( | ) | [inline] |
Basic Constructor.
Definition at line 18 of file eqheap.h.
Referenced by insert(), and insertDeterministic().
HeapNode::~HeapNode | ( | ) | [inline] |
void HeapNode::insert | ( | Event * | e | ) |
Insert event in heap.
Heap structure used for unexecuted portion of the eventQueue.
Insert event e in this subheap; designed to find insertion position quickly, at the cost of creating unbalanced or high & narrow heaps
Insert event in heap
Definition at line 7 of file eqheap.C.
References POSE_Config::deterministic, e, Event::evID, HeapNode(), insert(), insertDeterministic(), left, pose_config, right, sanitize(), subheapsize, and Event::timestamp.
Referenced by insert(), EqHeap::InsertDeterministic(), and EqHeap::InsertEvent().
void HeapNode::insertDeterministic | ( | Event * | e | ) |
Insert event in heap deterministically.
Insert event e in this subheap; designed to find insertion position quickly, at the cost of creating unbalanced or high & narrow heaps
Definition at line 56 of file eqheap.C.
References e, Event::evID, HeapNode(), insertDeterministic(), left, right, sanitize(), subheapsize, and Event::timestamp.
Referenced by insert(), and insertDeterministic().
Join this heap with h.
Join this heap with h and return the new heap; uses quickest join method possible at expense of creating unbalanced tree
Definition at line 102 of file eqheap.C.
References conjoin(), POSE_Config::deterministic, e, Event::evID, left, pose_config, right, sanitize(), subheapsize, and Event::timestamp.
Referenced by conjoin(), EqHeap::DeleteEvent(), EqHeap::GetAndRemoveTopEvent(), and remove().
int HeapNode::remove | ( | eventID | evID, | |
POSE_TimeType | timestamp | |||
) |
Remove heap node matching evID.
Definition at line 137 of file eqheap.C.
References conjoin(), e, Event::evID, left, remove(), right, sanitize(), subheapsize, and Event::timestamp.
Referenced by EqHeap::DeleteEvent(), and remove().
POSE_TimeType HeapNode::findMax | ( | ) | [inline] |
Find maximum element.
Definition at line 40 of file eqheap.h.
References e, findMax(), left, max(), POSE_UnsetTS, right, and Event::timestamp.
Referenced by EqHeap::FindMax(), and findMax().
void HeapNode::dump | ( | ) |
Dump all data fields.
Dump all data fields in entire subheap.
Definition at line 190 of file eqheap.C.
References dump(), eventID::dump(), e, Event::evID, left, right, and subheapsize.
Referenced by EqHeap::dump(), and dump().
char * HeapNode::dumpString | ( | ) |
Dump all data fields to a string.
Dump all data fields in entire subheap.
Definition at line 203 of file eqheap.C.
References dumpString(), e, Event::evID, eventID::getPE(), eventID::id, left, right, snprintf(), subheapsize, and Event::timestamp.
Referenced by dumpString().
void HeapNode::pup | ( | PUP::er & | p | ) |
Pack/unpack/sizing operator.
Packs/sizes the entire heap, DOES NOT UNPACK HEAP!!!
Recursively packs/sizes entire subheap; DOES NOT UNPACK HEAP!!!
Definition at line 230 of file eqheap.C.
References e, PUP::er::isUnpacking(), left, pup(), Event::pup(), and right.
Referenced by EqHeap::pup(), and pup().
void HeapNode::sanitize | ( | ) |
Check validity of data fields.
Definition at line 239 of file eqheap.C.
References e, left, right, sanitize(), Event::sanitize(), and subheapsize.
Referenced by conjoin(), insert(), insertDeterministic(), remove(), EqHeap::sanitize(), and sanitize().
Size of subheap topped by this node.
Definition at line 12 of file eqheap.h.
Referenced by conjoin(), dump(), dumpString(), EqHeap::GetAndRemoveTopEvent(), insert(), EqHeap::InsertDeterministic(), insertDeterministic(), EqHeap::InsertEvent(), remove(), and sanitize().
The event stored here.
Definition at line 14 of file eqheap.h.
Referenced by conjoin(), EqHeap::DeleteEvent(), dump(), dumpString(), findMax(), EqHeap::GetAndRemoveTopEvent(), insert(), EqHeap::InsertDeterministic(), insertDeterministic(), EqHeap::InsertEvent(), pup(), remove(), sanitize(), and ~HeapNode().
Left and right subheaps.
Definition at line 16 of file eqheap.h.
Referenced by conjoin(), EqHeap::DeleteEvent(), dump(), dumpString(), findMax(), EqHeap::GetAndRemoveTopEvent(), insert(), EqHeap::InsertDeterministic(), insertDeterministic(), EqHeap::InsertEvent(), pup(), remove(), sanitize(), and ~HeapNode().
Definition at line 16 of file eqheap.h.
Referenced by conjoin(), EqHeap::DeleteEvent(), dump(), dumpString(), findMax(), EqHeap::GetAndRemoveTopEvent(), insert(), EqHeap::InsertDeterministic(), insertDeterministic(), EqHeap::InsertEvent(), pup(), remove(), sanitize(), and ~HeapNode().