|
a/src/DIF/RMT/RMTQueue.cc |
|
b/src/DIF/RMT/RMTQueue.cc |
|
... |
|
... |
34 |
void RMTQueue::finish()
|
34 |
void RMTQueue::finish()
|
35 |
{
|
35 |
{
|
36 |
size_t pduCount = queue.size();
|
36 |
size_t pduCount = queue.size();
|
37 |
if (pduCount)
|
37 |
if (pduCount)
|
38 |
{
|
38 |
{
|
39 |
EV << "This queue still contains " << pduCount << " unprocessed PDUs!" << endl;
|
39 |
EV << "Queue " << getFullPath() << " still contains " << pduCount
|
|
|
40 |
<< " unprocessed PDUs!" << endl;
|
40 |
|
41 |
|
41 |
for (iterator it = begin(); it != end(); ++it)
|
42 |
for (iterator it = begin(); it != end(); ++it)
|
42 |
{
|
43 |
{
|
43 |
cPacket* p = *it;
|
44 |
cPacket* p = *it;
|
44 |
EV << p->getClassName() << " received at " << p->getArrivalTime() << endl;
|
45 |
EV << p->getClassName() << " received at " << p->getArrivalTime() << endl;
|
|
... |
|
... |
51 |
{
|
52 |
{
|
52 |
outputGate = gate("outputGate");
|
53 |
outputGate = gate("outputGate");
|
53 |
inputGate = gate("inputGate");
|
54 |
inputGate = gate("inputGate");
|
54 |
// message retrieval signal handler
|
55 |
// message retrieval signal handler
|
55 |
sigRMTPDURcvd = registerSignal(SIG_RMT_QueuePDURcvd);
|
56 |
sigRMTPDURcvd = registerSignal(SIG_RMT_QueuePDURcvd);
|
|
|
57 |
// message pre-departure signal handler
|
|
|
58 |
sigRMTPDUPreSend = registerSignal(SIG_RMT_QueuePDUPreSend);
|
56 |
// message departure signal handler
|
59 |
// message departure signal handler
|
57 |
sigRMTPDUSent = registerSignal(SIG_RMT_QueuePDUSent);
|
60 |
sigRMTPDUSent = registerSignal(SIG_RMT_QueuePDUSent);
|
58 |
// length for vector stats
|
61 |
// length for vector stats
|
59 |
sigStatRMTQueueLength = registerSignal(SIG_STAT_RMTQUEUE_LENGTH);
|
62 |
sigStatRMTQueueLength = registerSignal(SIG_STAT_RMTQUEUE_LENGTH);
|
60 |
|
63 |
|
|
... |
|
... |
100 |
{
|
103 |
{
|
101 |
disp.setTagArg("i", 1, "");
|
104 |
disp.setTagArg("i", 1, "");
|
102 |
}
|
105 |
}
|
103 |
else if (len < thresholdQLength)
|
106 |
else if (len < thresholdQLength)
|
104 |
{
|
107 |
{
|
105 |
disp.setTagArg("i", 1, getParentModule()->getParentModule()->par("queueColorBusy").stringValue());
|
108 |
disp.setTagArg("i", 1, "#80FF80");
|
106 |
}
|
109 |
}
|
107 |
else if (len < maxQLength)
|
110 |
else if (len < maxQLength)
|
108 |
{
|
111 |
{
|
109 |
disp.setTagArg("i", 1, getParentModule()->getParentModule()->par("queueColorWarn").stringValue());
|
112 |
disp.setTagArg("i", 1, "#FF8000");
|
110 |
}
|
113 |
}
|
111 |
else
|
114 |
else
|
112 |
{
|
115 |
{
|
113 |
disp.setTagArg("i", 1, getParentModule()->getParentModule()->par("queueColorFull").stringValue());
|
116 |
disp.setTagArg("i", 1, "#800000");
|
114 |
}
|
117 |
}
|
115 |
|
118 |
|
116 |
// print current saturation in numbers
|
119 |
// print current saturation in numbers
|
117 |
std::ostringstream desc;
|
120 |
std::ostringstream desc;
|
118 |
desc << " " << len << "/" << maxQLength;
|
121 |
desc << " " << len << "/" << maxQLength;
|
|
... |
|
... |
144 |
{
|
147 |
{
|
145 |
Enter_Method("releasePDU()");
|
148 |
Enter_Method("releasePDU()");
|
146 |
|
149 |
|
147 |
if (this->getLength() > 0)
|
150 |
if (this->getLength() > 0)
|
148 |
{
|
151 |
{
|
|
|
152 |
emit(sigRMTPDUPreSend, this);
|
149 |
cPacket* pdu = queue.front();
|
153 |
cPacket* pdu = queue.front();
|
150 |
queue.pop_front();
|
154 |
queue.pop_front();
|
151 |
send(pdu, outputGate);
|
155 |
send(pdu, outputGate);
|
152 |
|
156 |
|
153 |
if (getLength() == 0)
|
157 |
if (getLength() == 0)
|