TTEthernet Model for INET Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TTEOutput.h
Go to the documentation of this file.
1 #ifndef __INET_TTEOUTPUT_H
2 #define __INET_TTEOUTPUT_H
3 
4 #include <omnetpp.h>
5 #include <csimplemodule.h>
6 #include <INETDefs.h>
7 #include <TTE4INETDefs.h>
8 #include <IPassiveQueue.h>
9 #include <QueueWithQoS.h>
10 #include <EtherFrame_m.h>
11 #include <TTBuffer.h>
12 #include <PCFrame_m.h>
13 
14 namespace TTEthernetModel {
15 
20 class TTEOutput : public cSimpleModule, public IPassiveQueue
21 {
22  public:
26  TTEOutput();
30  ~TTEOutput();
31 
37  virtual void handleParameterChange(const char* parname);
41  virtual void addListener(IPassiveQueueListener *listener);
42 
46  virtual void removeListener(IPassiveQueueListener *listener);
47  private:
51  cChannel *outChannel;
55  unsigned int framesRequested;
56 
61  cQueue ttQueue;
62 
67 
71  cQueue beQueue;
72 
76  cQueue pcfQueue;
77 
83  std::vector < TTBuffer * > ttBuffers;
84 
90  std::list < IPassiveQueueListener * > listeners;
91 
95  size_t ttBuffersPos;
96  protected:
100  static simsignal_t ttQueueLengthSignal;
101 
105  static simsignal_t beQueueLengthSignal;
109  static simsignal_t pcfQueueLengthSignal;
110  private:
121  virtual bool isTransmissionAllowed(EtherFrame *message);
122 
129  virtual void setTransparentClock(PCFrame *pcf);
130 
134  virtual void registerTTBuffer(TTBuffer *buffer);
135 
136  protected:
140  virtual void initialize();
141 
142 
156  virtual void handleMessage(cMessage *msg);
157 
165  virtual void requestPacket();
166 
170  virtual int getNumPendingRequests();
171 
177  virtual bool isEmpty();
178 
182  virtual void clear();
183 
184  void notifyListeners();
185 };
186 }
187 
188 #endif
189