RINASim  October 2016
Documentation of framework for OMNeT++
EFCPTable.cc
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.
30 #include "EFCPTable.h"
31 
33 
35 {
36 
37 // efcpTable.clear();
38 
39 
40 }
41 
43 {
44 
45 }
46 
47 void EFCPTable::handleMessage(cMessage* msg){
48 
49 }
50 
52 
53 // WATCH_LIST(efcpTable);
54 }
55 
56 std::string EFCPTable::info() const {
57  std::ostringstream os;
58  os << "id=" << endl;// this->getId() << endl;
59  /*
60  for(TFTConstIter it = FaiTable.begin(); it != FaiTable.end(); ++it )
61  {
62  FAITableEntry tft = *it;
63  os << tft << endl;
64  }
65  */
66  return os.str();
67 }
68 
75 
76  for(TEFCPTable::iterator it = this->efcpTable.begin(); it != efcpTable.end(); ++it){
77 
78 
79  if((*it)->getFlow()->getConId() == flow->getConId()){
80  return (*it);
81  }
82  }
83 
84  return nullptr;
85 
86 }
87 
94 
95  for(TEFCPTable::iterator it = this->efcpTable.begin(); it!= efcpTable.end(); ++it){
96 
97  for(TEFCPITab::const_iterator efcpiIt = (*it)->getEfcpiTab()->begin(); efcpiIt != (*it)->getEfcpiTab()->end(); ++efcpiIt){
98  if((*efcpiIt) == efcpi){
99  return (*it);
100  }
101  }
102  }
103 
104  return NULL;
105 
106 }
107 
114 
115 
116  for(TEFCPTable::iterator it = this->efcpTable.begin(); it!= efcpTable.end(); ++it){
117 
118  if((*it)->getDelimit() == delimit){
119  return (*it);
120  }
121  }
122 
123  return NULL;
124 
125 }
126 
127 
128 
130 // Enter_Method("insertEntry(EFCPTableEntry* entry)");
131 
132 // this->efcpTable.empty();
133  this->efcpTable.push_back(entry);
134 
135 
136 }
137 
139 {
140 
141  for(TEFCPTable::iterator it = this->efcpTable.begin(); it!= efcpTable.end(); ++it){
142 
143  if((*it)->getFlow()->getConId().getSrcCepId() == srcCEP){
144  //TODO B1 What to return in case of multiple EFCPi per Flow?
145  return (*it)->getEfcpiTab()->front()->getDtp();
146  }
147  }
148  return NULL;
149 }
Class representing flow object with attributes from specs.
Definition: Flow.h:45
EFCPTableEntry * getEntryByFlow(const Flow *flow)
Definition: EFCPTable.cc:74
EFCPTableEntry * getEntryByDelimit(Delimiting *delimit)
Definition: EFCPTable.cc:113
Define_Module(EFCPTable)
DTP * getDTPBySrcCEP(int srcCEP)
Definition: EFCPTable.cc:138
virtual ~EFCPTable()
Definition: EFCPTable.cc:42
EFCPTableEntry * getEntryByEFCPI(EFCPInstance *efcpi)
Definition: EFCPTable.cc:93
void insertEntry(EFCPTableEntry *entry)
Definition: EFCPTable.cc:129
virtual void initialize()
Definition: EFCPTable.cc:51
std::string info() const
Definition: EFCPTable.cc:56
TEFCPTable efcpTable
Definition: EFCPTable.h:44
const ConnectionId & getConId() const
Gets read-only Flow's ConnectionId.
Definition: Flow.cc:86
Definition: DTP.h:60
virtual void handleMessage(cMessage *msg)
Definition: EFCPTable.cc:47