RINASim  October 2016
Documentation of framework for OMNeT++
ConnectionTable.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 #ifndef __RINA_CONNECTIONTABLE_H_
24 #define __RINA_CONNECTIONTABLE_H_
25 
26 //Standard libraries
27 #include <omnetpp.h>
28 //RINASim libraries
29 #include <ConnectionTableEntry.h>
30 
31 typedef std::list<ConnectionTableEntry> TConTable;
32 typedef TConTable::iterator TCTIter;
33 typedef TConTable::const_iterator TCTConstIter;
34 
35 class ConnectionTable : public cSimpleModule
36 {
37  public:
38  std::string info() const;
39 
40  void insertNew(Flow* flow);
41  void insert(const ConnectionTableEntry& entry);
42  void remove();
43 
46 
47  cGate* findOutputGate(cGate* input, bool& isGoingUp);
48 
49  bool setSouthGates(Flow* flow, cGate* sIn, cGate* sOut);
50  bool setNorthGates(Flow* flow, cGate* nIn, cGate* nOut);
51  bool setFa(Flow* flow, FABase* fa);
54 
55  FABase* getFa(Flow* flow);
56 
57  protected:
58  virtual void initialize();
59  virtual void handleMessage(cMessage *msg);
60 
61  private:
63 };
64 
65 #endif
bool setStatus(Flow *flow, ConnectionTableEntry::ConnectionStatus status)
Class representing flow object with attributes from specs.
Definition: Flow.h:45
cGate * findOutputGate(cGate *input, bool &isGoingUp)
ConnectionStatus
bool setNorthGates(Flow *flow, cGate *nIn, cGate *nOut)
void insert(const ConnectionTableEntry &entry)
FABase * getFa(Flow *flow)
APNamingInfo holds complete naming info for particular application process.
Definition: APNamingInfo.h:43
bool setFa(Flow *flow, FABase *fa)
ConnectionTableEntry::ConnectionStatus getStatus(Flow *flow)
virtual void handleMessage(cMessage *msg)
std::list< ConnectionTableEntry > TConTable
void insertNew(Flow *flow)
ConnectionTableEntry * findEntryByFlow(Flow *flow)
std::string info() const
TConTable ConTable
TConTable::iterator TCTIter
virtual void initialize()
Definition: FABase.h:33
bool setSouthGates(Flow *flow, cGate *sIn, cGate *sOut)
ConnectionTableEntry * findEntryByAPNI(const APNamingInfo &apni)
TConTable::const_iterator TCTConstIter