RINASim  October 2016
Documentation of framework for OMNeT++
Socket.h
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 /*
23  * @file Socket.h
24  * @author Marcel Marek
25  * @date Apr 28, 2016
26  * @brief
27  * @detail
28  */
29 
30 #ifndef SOCKET_H_
31 #define SOCKET_H_
32 
33 #include "RINASignals.h"
34 #include "ExternConsts.h"
35 #include <omnetpp.h>
36 #include "QueueInfo.h"
37 #include <queue>
38 #include "Flow.h"
39 
40 class Socket : public cSimpleModule
41 {
42 private:
43  bool readImm;
44  std::queue<cMessage*> toAE;
46 
47  //signals
48  simsignal_t sigSocketQueueInfo;
49 
50  int inputQCapacity; // input from network
51 
53 
54  public:
55  Socket();
56  virtual ~Socket();
57  void handleMessage(cMessage* msg);
58  void initialize(int step);
59  Flow* getFlow() const;
60  void setFlow(Flow* flow);
61 
62  protected:
63  int numInitStages() const
64  {
65  return 4;
66  }
67 };
68 
69 #endif /* SOCKET_H_ */
Class representing flow object with attributes from specs.
Definition: Flow.h:45
void setFlow(Flow *flow)
Definition: Socket.cc:52
void handleMessage(cMessage *msg)
Definition: Socket.cc:70
QueueInfo * makeQueueInfo()
Definition: Socket.cc:60
Socket()
Definition: Socket.cc:35
virtual ~Socket()
Definition: Socket.cc:56
Flow * getFlow() const
Definition: Socket.cc:41
std::queue< cMessage * > toAE
Definition: Socket.h:44
Flow * flow
Definition: Socket.h:45
simsignal_t sigSocketQueueInfo
Definition: Socket.h:48
void initialize(int step)
Definition: Socket.cc:45
Definition: Socket.h:40
int numInitStages() const
Definition: Socket.h:63
int inputQCapacity
Definition: Socket.h:50
bool readImm
Definition: Socket.h:43