Project

General

Profile

Revision 96e929a8

ID96e929a8aca87819d829629798726a90312b8093

Added by Simon Tenbusch over 9 years ago

[eefscheduler] encapsulated getProcessingDelay-call in the getEventDuration() of cMessage
The duration of a message is invalidated in scheduleAt and sendDirect/Delayed

View differences:

src/sim/cmessage.cc
27 27
#include "cmessage.h"
28 28
#include "cexception.h"
29 29
#include "cenvir.h"
30
#include "casyncmodule.h"
30 31

  
31 32
#ifdef WITH_PARSIM
32 33
#include "ccommbuffer.h"
......
82 83
    prev_event_num = -1;
83 84

  
84 85
    duration = -1;
85

  
86 86
    msgtreeid = msgid = AO_fetch_and_add1(&next_id);
87 87
    AO_fetch_and_add1(&total_msgs);
88 88
    AO_fetch_and_add1(&live_msgs);
......
363 363
    delivd = t;
364 364
}
365 365

  
366
simtime_t cMessage::getEventDuration() {
367
    if (duration < 0) {
368
        cSimpleModule* mod = (cSimpleModule*) simulation.getModule(getArrivalModuleId());
369
        if (mod->isAsyncModule()) {
370
            duration = ((cAsyncModule*) mod)->getProcessingDelay(this);
371
        }
372
    }
373
    return duration;
374
}
375

  
366 376
//----
367 377

  
368 378
cPacket::cPacket(const cPacket& pkt) : cMessage(pkt)
......
656 666

  
657 667

  
658 668

  
659

  

Also available in: Unified diff