Project

General

Profile

Revision 18befb2d

ID18befb2d221b81a1c559d2453678c96e609537d0
Parent 04a70d7c
Child f22bd539

Added by Mirko Stoffers over 7 years ago

Module will now create new entries into the event type list when new event types occur

View differences:

src/sim/cmodule.cc
1406 1406

  
1407 1407
EventType* cModule::getEventType(cMessage* msg)
1408 1408
{
1409
	// TODO: right now only pseudo event type!
1410
	EventType* type=new EventType();
1411
	type->setModId(getId());
1412
	return type;
1409
	// Event type exists?
1410
	for(knownEventTypes_t::iterator it=knownEventTypes.begin();it!=knownEventTypes.end();++it)
1411
	{
1412
		if(*it==*msg)
1413
		{
1414
			return &(*it);
1415
		}
1416
	}
1417

  
1418
	// If event type does not exist, create it:
1419
	knownEventTypes.emplace_back(msg);
1420
	return &knownEventTypes.back();
1413 1421
}
1414 1422

  

Also available in: Unified diff