-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQueue.h
More file actions
28 lines (27 loc) · 785 Bytes
/
Queue.h
File metadata and controls
28 lines (27 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <omnetpp.h>
#include "Job_m.h"
using namespace omnetpp;
#include "StatsCollector.h"
class StatsCollector; // reference StatsCollector to have a pointer to this class
class Queue : public cSimpleModule{
private:
simsignal_t droppedSignal;
simsignal_t queueLengthSignal;
simsignal_t queueLatency;
Job *jobServiced = nullptr;
cMessage *endServiceMsg = nullptr;
cQueue queue;
int capacity;
StatsCollector* collector = nullptr;
public:
virtual ~Queue();
cQueue queueToSend;
Job* popJob();
int getQueueLength();
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
virtual simtime_t startService(Job *job);
virtual void endService(Job *job);
void updateDisplay();
};