TTEthernet Model for INET Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TTEthernetModel::TTTrafficSourceApp Class Reference

Simple Test-Application. More...

#include <TTTrafficSourceApp.h>

Inheritance diagram for TTEthernetModel::TTTrafficSourceApp:
TTEthernetModel::TrafficSourceAppBase TTEthernetModel::TTEApplicationBase

Public Member Functions

 TTTrafficSourceApp ()
 

Protected Member Functions

virtual void initialize ()
 Initialization of the module. More...
 
virtual void handleMessage (cMessage *msg)
 Handles message generation. More...
 
- Protected Member Functions inherited from TTEthernetModel::TrafficSourceAppBase
virtual void sendMessage ()
 Generates and sends a new Message. More...
 

Private Attributes

unsigned int moduloCycle
 

Additional Inherited Members

- Protected Attributes inherited from TTEthernetModel::TTEApplicationBase
std::map< uint16_t, std::list
< Buffer * > > 
buffers
 Map of critical traffic identifies with their corresponding Buffers. More...
 

Detailed Description

Simple Test-Application.

See Also
TTEApplicationBase

Definition at line 31 of file TTTrafficSourceApp.h.

Constructor & Destructor Documentation

TTEthernetModel::TTTrafficSourceApp::TTTrafficSourceApp ( )

Definition at line 24 of file TTTrafficSourceApp.cc.

24  :moduloCycle(0){
25 }

Member Function Documentation

void TTEthernetModel::TTTrafficSourceApp::handleMessage ( cMessage *  msg)
protectedvirtual

Handles message generation.

Definition at line 38 of file TTTrafficSourceApp.cc.

38  {
39 
40  if(msg->arrivedOn("schedulerIn")){
41  moduloCycle++;
42  if(moduloCycle==(unsigned int)par("modulo").longValue()){
43  sendMessage();
44  moduloCycle=0;
45  }
46 
47  TTEScheduler *tteScheduler = (TTEScheduler*) getParentModule()->getSubmodule("tteScheduler");
48  SchedulerActionTimeEvent *event = (SchedulerActionTimeEvent *)msg;
49  tteScheduler->registerEvent(event, true);
50  }
51  else{
52  delete msg;
53  }
54 }
void TTEthernetModel::TTTrafficSourceApp::initialize ( )
protectedvirtual

Initialization of the module.

Sends activator message

Reimplemented from TTEthernetModel::TrafficSourceAppBase.

Definition at line 27 of file TTTrafficSourceApp.cc.

28 {
30 
31  TTEScheduler *tteScheduler = (TTEScheduler*) getParentModule()->getSubmodule("tteScheduler");
32  SchedulerActionTimeEvent *event = new SchedulerActionTimeEvent("API Scheduler Task Event", ACTION_TIME_EVENT);
33  event->setAction_time(par("action_time").doubleValue()/tteScheduler->par("tick").doubleValue());
34  event->setDestinationGate(gate("schedulerIn"));
35  tteScheduler->registerEvent(event);
36 }

Member Data Documentation

unsigned int TTEthernetModel::TTTrafficSourceApp::moduloCycle
private

Definition at line 34 of file TTTrafficSourceApp.h.

Referenced by handleMessage().


The documentation for this class was generated from the following files: