#include <eqheap.h>
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. | |
Event * | GetAndRemoveTopEvent () |
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 | |
HeapNode * | top |
Top node of heap. | |
Private Attributes | |
int | heapSize |
Size of heap. |
Definition at line 61 of file eqheap.h.
int EqHeap::size | ( | void | ) | [inline] |
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().
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().
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().
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().
POSE_TimeType EqHeap::FindMax | ( | ) | [inline] |
Find maximum element.
Definition at line 87 of file eqheap.h.
References HeapNode::findMax(), POSE_UnsetTS, and top.
void EqHeap::dump | ( | ) |
Dump entire heap.
Definition at line 438 of file eqheap.C.
References HeapNode::dump(), and top.
Referenced by eventQueue::CommitEvents().
char * EqHeap::dumpString | ( | ) |
Dump entire heap to a string.
Definition at line 447 of file eqheap.C.
Referenced by eventQueue::CommitEvents().
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().
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().
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().
Top node of heap.
Definition at line 66 of file eqheap.h.
Referenced by eventQueue::CommitEvents(), DeleteEvent(), dump(), FindMax(), GetAndRemoveTopEvent(), InsertDeterministic(), InsertEvent(), pup(), sanitize(), and ~EqHeap().