Switch to unified view

a b/src/DAF/IRM/ConnectionTableEntry.h
1
//
2
// This program is free software: you can redistribute it and/or modify
3
// it under the terms of the GNU Lesser General Public License as published by
4
// the Free Software Foundation, either version 3 of the License, or
5
// (at your option) any later version.
6
// 
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
// GNU Lesser General Public License for more details.
11
// 
12
// You should have received a copy of the GNU Lesser General Public License
13
// along with this program.  If not, see http://www.gnu.org/licenses/.
14
// 
15
16
#ifndef CONNECTIONTABLEENTRY_H_
17
#define CONNECTIONTABLEENTRY_H_
18
19
//Standard libraries
20
#include <string>
21
//RINASim libraries
22
#include "Flow.h"
23
#include "FABase.h"
24
25
class ConnectionTableEntry {
26
  public:
27
    enum ConnectionStatus {UNKNOWN,
28
                           NIL,
29
                           FLOWPENDING,
30
                           CONNECTPENDING,
31
                           AUTHENTICATING,
32
                           ESTABLISHED,
33
                           RELEASING};
34
35
    //De-constructors
36
    ConnectionTableEntry();
37
    ConnectionTableEntry(Flow* flow);
38
    ConnectionTableEntry(Flow* flow, cGate* nIn, cGate* nOut);
39
    virtual ~ConnectionTableEntry();
40
41
    std::string info() const;
42
    std::string getConnectionStatusString() const;
43
44
    //Getters and Setters
45
    void setConStatus(ConnectionStatus conStatus);
46
    FABase* getFlowAlloc() const;
47
    void setFlowAlloc(FABase* flowAlloc);
48
    Flow* getFlowObject() const;
49
    void setFlowObject(Flow* flowObject);
50
    cGate* getNorthGateIn() const;
51
    void setNorthGateIn(cGate* northGateIn);
52
    cGate* getNorthGateOut() const;
53
    void setNorthGateOut(cGate* northGateOut);
54
    cGate* getSouthGateIn() const;
55
    void setSouthGateIn(cGate* southGateIn);
56
    cGate* getSouthGateOut() const;
57
    void setSouthGateOut(cGate* southGateOut);
58
59
    cModule* getIpc() const;
60
61
  private:
62
    Flow*   FlowObject;
63
    ConnectionStatus conStatus;
64
    cGate*  northGateIn;
65
    cGate*  northGateOut;
66
    cGate*  southGateIn;
67
    cGate*  southGateOut;
68
    FABase* FlowAlloc;
69
};
70
71
//Free function
72
std::ostream& operator<< (std::ostream& os, const ConnectionTableEntry& cte);
73
74
#endif /* CONNECTIONTABLEENTRY_H_ */