|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CEVENTHEAP_H
17 #define __OMNETPP_CEVENTHEAP_H
19 #include "cfutureeventset.h"
47 int cbhead = 0, cbtail = 0;
54 void shiftup(
int from=1);
56 int cblength()
const {
return (cbtail-cbhead) & (cbsize-1);}
57 cEvent *cbget(
int k) {
return cb[(cbhead+k) & (cbsize-1)];}
60 void heapInsert(
cEvent *event);
61 void cbInsert(
cEvent *event);
66 bool getUseCb()
const {
return useCb;}
67 void setUseCb(
bool b) {ASSERT(cbhead==cbtail); useCb = b;}
70 virtual void checkHeap();
84 cEventHeap(
const char *name=
nullptr,
int initialCapacity=128);
111 virtual std::string str()
const override;
117 virtual void forEachChild(
cVisitor *v)
override;
127 virtual void insert(
cEvent *event)
override;
133 virtual cEvent *peekFirst()
const override;
139 virtual cEvent *removeFirst()
override;
144 virtual void putBackFirst(
cEvent *event)
override;
155 virtual bool isEmpty()
const override {
return cbhead==cbtail && heapLength==0;}
160 virtual void clear()
override;
169 virtual int getLength()
const override {
return cblength() + heapLength;}
177 virtual cEvent *get(
int k)
override;
183 virtual void sort()
override;
virtual bool isEmpty() const override
Definition: ceventheap.h:155
Represents an event in the discrete event simulator.
Definition: cevent.h:46
Abstract base class for the future event set (FES), a central data structure for discrete event simul...
Definition: cfutureeventset.h:32
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
int64_t eventnumber_t
Sequence number of events during the simulation. Events are numbered from one. (Event number zero is ...
Definition: simkerneldefs.h:78
virtual int getLength() const override
Definition: ceventheap.h:169
The default, binary heap based implementation of the future event set.
Definition: ceventheap.h:35
virtual cEventHeap * dup() const override
Definition: ceventheap.h:105