-
Notifications
You must be signed in to change notification settings - Fork 6
/
context.h
50 lines (32 loc) · 1.12 KB
/
context.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 _context
#define _context
#include <new>
#include <string>
#include <iostream>
#include <stdio.h>
#include "topology.h"
#include "eventqueue.h"
#include "table.h"
class SimulationContext : public Topology, public EventQueue
{
public:
SimulationContext();
virtual ~SimulationContext();
void LoadTopology(const string &file);
void LoadEvents(const string &file);
void Init();
void SendToNeighbors(const Node *src, const RoutingMessage *m);
void SendToNeighbor(const Node *src, const Node *dest, const RoutingMessage *m);
void TimeOut(const Node *src, const double timefromnow);
void CollectPathLinks(const Node &src, const Node &dest, deque<Link> &links) const;
void DrawShortestPathTree(const Node *node) const;
void WriteShortestPathTreeDot(const Node *node, const string &s) const;
void DrawPath(const Link *l) const;
void WritePathDot(const Node &src, const Node &dest, const string &s) const;
void DumpTable(const Node *src);
void DispatchEvent(Event *e);
ostream &Print(ostream &os);
};
inline ostream & operator<<(ostream &os, SimulationContext &s)
{ return s.Print(os); }
#endif