OMNeT++ Simulation Library  6.0.3
cFutureEventSet Class Referenceabstract

#include <cfutureeventset.h>

Description

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).

See also
cSimulation::getFES()
Inheritance diagram for cFutureEventSet:
cOwnedObject cNamedObject cObject cEventHeap

Public Member Functions

Constructors, destructor, assignment
 cFutureEventSet (const char *name=nullptr)
 
virtual ~cFutureEventSet ()
 
cFutureEventSetoperator= (const cFutureEventSet &other)
 
Redefined cObject member functions.
virtual std::string str () const override
 
Simulation-related operations.
virtual void insert (cEvent *event)=0
 
virtual cEventpeekFirst () const =0
 
virtual cEventremoveFirst ()=0
 
virtual void putBackFirst (cEvent *event)=0
 
virtual cEventremove (cEvent *event)=0
 
virtual bool isEmpty () const =0
 
virtual void clear ()=0
 
Random access.
virtual int getLength () const =0
 
virtual cEventget (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 ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
virtual cObjectgetOwner () 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 ()
 
cNamedObjectoperator= (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 cObjectgetThisPtr () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual cObjectdup () const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cSoftOwnergetOwningContext ()
 
- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

◆ cFutureEventSet()

cFutureEventSet ( const char *  name = nullptr)
inline

Constructor.

◆ ~cFutureEventSet()

virtual ~cFutureEventSet ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ operator=()

cFutureEventSet& operator= ( const cFutureEventSet other)

Assignment operator. The name member is not copied; see cOwnedObject's operator=() for more details.

◆ str()

virtual std::string str ( ) const
overridevirtual

Produces a one-line description of the object's contents. See cObject for more details.

Reimplemented from cObject.

Reimplemented in cEventHeap.

◆ insert()

virtual void insert ( cEvent event)
pure virtual

Insert an event into the FES.

Implemented in cEventHeap.

◆ peekFirst()

virtual cEvent* peekFirst ( ) const
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.

◆ removeFirst()

virtual cEvent* removeFirst ( )
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.

◆ putBackFirst()

virtual void putBackFirst ( cEvent event)
pure virtual

Undo for removeFirst(): it puts back an event to the front of the FES.

Implemented in cEventHeap.

◆ remove()

virtual cEvent* remove ( cEvent event)
pure virtual

Removes and returns the given event in the FES. If the event is not in the FES, returns nullptr.

Implemented in cEventHeap.

◆ isEmpty()

virtual bool isEmpty ( ) const
pure virtual

Returns true if the FES is empty.

Implemented in cEventHeap.

◆ clear()

virtual void clear ( )
pure virtual

Deletes all events in the FES.

Implemented in cEventHeap.

◆ getLength()

virtual int getLength ( ) const
pure virtual

Returns the number of events in the FES.

Implemented in cEventHeap.

◆ get()

virtual cEvent* get ( int  k)
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.

◆ sort()

virtual void sort ( )
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.


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