Switch to unified view

a b/src/DAF/AE/AEBase.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 __RINA_AEBASE_H_
17
#define __RINA_AEBASE_H_
18
19
//Standard libraries
20
#include <omnetpp.h>
21
//RINASim libraries
22
#include "APNamingInfo.h"
23
#include "Flow.h"
24
#include "ExternConsts.h"
25
26
typedef std::list<Flow> Flows;
27
typedef Flows::iterator TFlowsIter;
28
29
//Consts
30
31
extern const char* PAR_AVGBW;
32
extern const char* PAR_AVGSDUBW;
33
extern const char* PAR_PEAKBWDUR;
34
extern const char* PAR_PEAKSDUBWDUR;
35
extern const char* PAR_BURSTPERIOD;
36
extern const char* PAR_BURSTDURATION;
37
extern const char* PAR_UNDETECTBITERR;
38
extern const char* PAR_MAXSDUSIZE;
39
extern const char* PAR_PARTIALDELIVER;
40
extern const char* PAR_INCOMPLETEDELIVER;
41
extern const char* PAR_FORCEORDER;
42
extern const char* PAR_MAXALLOWGAP;
43
extern const char* PAR_DELAY;
44
extern const char* PAR_JITTER;
45
extern const char* PAR_COSTTIME;
46
extern const char* PAR_COSTBITS;
47
48
class AEBase : public cSimpleModule
49
{
50
  public:
51
    bool hasFlow(const Flow* flow);
52
53
    const APNamingInfo& getApni() const;
54
    const Flows& getFlows() const;
55
56
    bool operator== (const AEBase& other) {
57
        return (apni == other.apni);
58
    }
59
60
  protected:
61
    Flows flows;
62
    APNamingInfo apni;
63
64
    std::string srcApName;
65
    std::string srcApInstance;
66
    std::string srcAeName;
67
    std::string srcAeInstance;
68
69
    QosCube QoSRequirements;
70
71
    //Getters/Setters
72
    const std::string& getSrcAeInstance() const;
73
    void setSrcAeInstance(const std::string& srcAeInstance);
74
    const std::string& getSrcAeName() const;
75
    void setSrcAeName(const std::string& srcAeName);
76
    const std::string& getSrcApInstance() const;
77
    void setSrcApInstance(const std::string& srcApInstance);
78
    const std::string& getSrcApName() const;
79
    void setSrcApName(const std::string& srcApName);
80
    void setApni(const APNamingInfo& apni);
81
    void setFlows(const Flows& flows);
82
    const QosCube& getQoSRequirements() const;
83
    void setQoSRequirements(const QosCube& qoSRequirements);
84
85
    void initNamingInfo();
86
    void initQoSRequiremets();
87
88
    void insertFlow(Flow& flow);
89
90
    virtual void initialize();
91
    virtual void handleMessage(cMessage *msg);
92
93
  private:
94
95
};
96
97
#endif