OMNeT++ Simulation Library
6.0.3
|
#include <cfutureeventset.h>
Abstract base class for the future event set (FES), a central data structure for discrete event simulation. FES is also known as FEL (future event list).
Public Member Functions | |
Constructors, destructor, assignment | |
cFutureEventSet (const char *name=nullptr) | |
virtual | ~cFutureEventSet () |
cFutureEventSet & | operator= (const cFutureEventSet &other) |
Redefined cObject member functions. | |
virtual std::string | str () const override |
Simulation-related operations. | |
virtual void | insert (cEvent *event)=0 |
virtual cEvent * | peekFirst () const =0 |
virtual cEvent * | removeFirst ()=0 |
virtual void | putBackFirst (cEvent *event)=0 |
virtual cEvent * | remove (cEvent *event)=0 |
virtual bool | isEmpty () const =0 |
virtual void | clear ()=0 |
Random access. | |
virtual int | getLength () const =0 |
virtual cEvent * | get (int k)=0 |
virtual void | sort ()=0 |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::ostream & | printOn (std::ostream &os) const |
virtual cObject * | dup () const |
virtual bool | isSoftOwner () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () const |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cSoftOwner * | getOwningContext () |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
cFutureEventSet& operator= | ( | const cFutureEventSet & | other | ) |
Assignment operator. The name member is not copied; see cOwnedObject's operator=() for more details.
|
overridevirtual |
Produces a one-line description of the object's contents. See cObject for more details.
Reimplemented from cObject.
Reimplemented in cEventHeap.
|
pure virtual |
Insert an event into the FES.
Implemented in cEventHeap.
|
pure virtual |
Peek the first event in the FES (the one with the smallest timestamp.) If the FES is empty, it returns nullptr.
Implemented in cEventHeap.
|
pure virtual |
Removes and return the first event in the FES (the one with the smallest timestamp.) If the FES is empty, it returns nullptr.
Implemented in cEventHeap.
|
pure virtual |
Undo for removeFirst(): it puts back an event to the front of the FES.
Implemented in cEventHeap.
Removes and returns the given event in the FES. If the event is not in the FES, returns nullptr.
Implemented in cEventHeap.
|
pure virtual |
Returns true if the FES is empty.
Implemented in cEventHeap.
|
pure virtual |
Deletes all events in the FES.
Implemented in cEventHeap.
|
pure virtual |
Returns the number of events in the FES.
Implemented in cEventHeap.
|
pure virtual |
Returns the kth event in the FES if 0 <= k < getLength(), and nullptr otherwise. Note that iteration does not necessarily return events in increasing timestamp (getArrivalTime()) order unless sort() has been called since the last mutating operation.
get(k) is very often called in a loop that goes from 0 to getLength()-1, so implementations that employ a data structure that is ill-suited for random access (e.g. list or tree-based) are advised to cache the information used to look up the kth item, and reuse it for a subsequent get(k+1) call.
Implemented in cEventHeap.
|
pure virtual |
Sorts the contents of the FES. This is only necessary if one wants to iterate through events in the FES in strict timestamp order.
Implemented in cEventHeap.