-
Notifications
You must be signed in to change notification settings - Fork 6
/
topology.h
51 lines (34 loc) · 1.07 KB
/
topology.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _topology
#define _topology
#include <deque>
#include <string>
#include "node.h"
#include "link.h"
class Topology
{
protected:
deque<Node*> nodes;
deque<Link*> links;
deque<Node*>::iterator FindMatchingNodeIt(const Node *n);
deque<Link*>::iterator FindMatchingLinkIt(const Link *l);
public:
Topology();
virtual ~Topology();
Node *FindMatchingNode(const Node *n);
deque<Link*> *GetOutgoingLinks(const Node *n);
deque<Node*> *GetNeighbors(const Node *n);
void CollectShortestPathTreeLinks(const Node &src, deque<Link> &links);
void CollectShortestPathLinks(const Node &src, const Node &dest, deque<Link> &links);
void AddNode(Node *n);
void DeleteNode(const Node *n);
void ChangeNode(const Node *n);
Link *FindMatchingLink(const Link *l);
void AddLink(Link *n);
void DeleteLink(const Link *n);
void ChangeLink(const Link *n);
void WriteDot(const string &fn) const;
void DrawTopology() const;
ostream & Print(ostream &os) const;
} ;
inline ostream & operator<<(ostream &os, const Topology &t) { return t.Print(os);};
#endif