Switch to unified view

a b/src/policies/DIF/RA/PDUFG/SimpleGenerator/SimpleGenerator.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 SimpleGenerator_H_
17
#define SimpleGenerator_H_
18
19
#include <IntPDUFG.h>
20
#include <SimpleTable/SimpleTable.h>
21
#include <SimpleRouting/IntSimpleRouting.h>
22
23
#include <map>
24
#include <set>
25
26
namespace SimpleGenerator {
27
28
typedef std::set<RMTPort*> PortsSet;
29
typedef std::map<unsigned short, PortsSet> Nentries;
30
typedef std::map<std::string, Nentries> NTable;
31
32
typedef PortsSet::iterator PortsSetIt;
33
typedef Nentries::iterator NentriesIt;
34
typedef NTable::iterator NTableIt;
35
36
37
class SimpleGenerator: public IntPDUFG {
38
public:
39
    // A new flow has been inserted/or removed
40
    virtual void insertedFlow(const Address &addr, const unsigned short &qos, RMTPort * port);
41
    virtual void removedFlow(const Address &addr, const unsigned short &qos, RMTPort * port);
42
43
    //Routing has processes a routing update
44
    virtual void routingUpdated();
45
46
protected:
47
    // Called after initialize
48
    virtual void onPolicyInit();
49
50
private:
51
    DA * difA;
52
    SimpleTable::SimpleTable * fwd;
53
    IntSimpleRouting * rt;
54
55
    NTable neighbours;
56
};
57
58
}
59
60
#endif /* STATICGENERATOR_H_ */