16 #ifndef __OMNETPP_CQUEUE_H 17 #define __OMNETPP_CQUEUE_H 19 #include "cownedobject.h" 97 void init(
const cQueue& q,
bool reverse=
false) {p = reverse ? q.backp : q.frontp;}
112 bool end()
const {
return p ==
nullptr;}
146 bool takeOwnership =
true;
147 QElem *frontp =
nullptr, *backp =
nullptr;
152 void copy(
const cQueue& other);
156 QElem *find_qelem(
cObject *obj)
const;
157 void insbefore_qelem(QElem *p,
cObject *obj);
158 void insafter_qelem(QElem *p,
cObject *obj);
159 cObject *remove_qelem(QElem *p);
173 cQueue(
const char *name, CompareFunc cmp);
211 virtual std::string str()
const override;
217 virtual void forEachChild(
cVisitor *v)
override;
224 virtual void parsimPack(
cCommBuffer *buffer)
const override;
231 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
246 virtual void setup(CompareFunc cmp);
252 virtual void insert(
cObject *obj);
284 virtual void clear();
294 virtual cObject *front()
const;
306 virtual int getLength()
const;
316 _OPPDEPRECATED
int length()
const {
return getLength();}
321 _OPPDEPRECATED
bool empty()
const {
return isEmpty();}
328 virtual cObject *
get(
int i)
const;
333 virtual bool contains(
cObject *obj)
const;
bool isEmpty() const
Definition: cqueue.h:311
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
_OPPDEPRECATED cObject * operator()() const
Definition: cqueue.h:107
Iterator & operator--()
Definition: cqueue.h:133
_OPPDEPRECATED bool empty() const
Definition: cqueue.h:321
bool end() const
Definition: cqueue.h:112
Iterator & operator++()
Definition: cqueue.h:119
Iterator(const cQueue &q, bool reverse=false)
Definition: cqueue.h:92
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:104
_OPPDEPRECATED int length() const
Definition: cqueue.h:316
Iterator operator++(int)
Definition: cqueue.h:126
int(* CompareFunc)(cObject *a, cObject *b)
Function for comparing two cObjects, used by cQueue for priority queuing.
Definition: cqueue.h:76
void setTakeOwnership(bool tk)
Definition: cqueue.h:351
Queue class for objects derived from cObject.
Definition: cqueue.h:42
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
Walks along a cQueue.
Definition: cqueue.h:81
Definition: cabstracthistogram.h:21
bool getTakeOwnership() const
Definition: cqueue.h:358
virtual cQueue * dup() const override
Definition: cqueue.h:205
Base class for object comparators, used by cQueue for priority queuing.
Definition: cqueue.h:57
cObject * operator*() const
Definition: cqueue.h:102
void init(const cQueue &q, bool reverse=false)
Definition: cqueue.h:97
Iterator operator--(int)
Definition: cqueue.h:140