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

Base class for a TTEthernet-Application. More...

#include <TTEApplicationBase.h>

Inheritance diagram for TTEthernetModel::TTEApplicationBase:
TTEthernetModel::TrafficSourceAppBase TTEthernetModel::TTEAPIApplicationBase TTEthernetModel::TTETestApp TTEthernetModel::RCTrafficSourceApp TTEthernetModel::TTTrafficSourceApp TTEthernetModel::TTEAPITestApplication

Public Member Functions

virtual void executeCallback (Callback *cb)
 executes the given Callback in the context of the Application More...
 
virtual void handleParameterChange (const char *parname)
 Indicates a parameter has changed. More...
 

Protected Attributes

std::map< uint16_t, std::list
< Buffer * > > 
buffers
 Map of critical traffic identifies with their corresponding Buffers. More...
 

Detailed Description

Base class for a TTEthernet-Application.

Containes the mapping to Buffers and the ability to execute Callbacks

See Also
Buffer, Callback

Definition at line 36 of file TTEApplicationBase.h.

Member Function Documentation

void TTEthernetModel::TTEApplicationBase::executeCallback ( Callback cb)
virtual

executes the given Callback in the context of the Application

Parameters
cbthe Callback to execute

Definition at line 24 of file TTEApplicationBase.cc.

24  {
25  Enter_Method("executeCallback(cb)");
26  cb->executeCallback();
27 }
void TTEthernetModel::TTEApplicationBase::handleParameterChange ( const char *  parname)
virtual

Indicates a parameter has changed.

Parameters
parnameName of the changed parameter or NULL if multiple parameter changed.

Definition at line 29 of file TTEApplicationBase.cc.

29  {
30  buffers.clear();
31  if(ev.isGUI()){
32  //TODO check why this does not work
33  getDisplayString().setTagArg("i2", 0, "");
34  getDisplayString().setTagArg("tt", 0, "");
35  }
36  std::string buffersString = par("buffers").stdstringValue();
37  std::vector<std::string> bufferPaths;
38  split(buffersString,',',bufferPaths);
39  for(std::vector<std::string>::iterator bufferPath = bufferPaths.begin();
40  bufferPath!=bufferPaths.end();bufferPath++){
41  cModule* module = simulation.getModuleByPath((*bufferPath).c_str());
42  if(module){
43  Buffer *buffer = dynamic_cast<Buffer*> (module);
44  if(buffer && buffer->hasPar("ct_id")){
45  buffers[buffer->par("ct_id").longValue()].push_back(buffer);
46  }
47  }
48  else{
49  if(ev.isGUI()){
50  ev<<"Configuration problem: Module "<<(*bufferPath)<<" could not be resolved or is no CT-Buffer (TT or RC)!"<<endl;
51  getDisplayString().setTagArg("i2", 0, "status/excl3");
52  getDisplayString().setTagArg("tt", 0, "WARNING: Configuration Problem Application Buffer!");
53  }
54  }
55  }
56 }

Member Data Documentation

std::map<uint16_t, std::list<Buffer*> > TTEthernetModel::TTEApplicationBase::buffers
protected

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