Statistics
| Branch: | Revision:

root / custompackages / graph-parser / src / common.h @ c6961065

History | View | Annotate | Download (729 Bytes)

1
//
2
// Created by quynh on 12/13/15.
3
//
4

    
5
#ifndef GRAPH_PARSER_COMMON_H
6
#define GRAPH_PARSER_COMMON_H
7

    
8
#include <boost/graph/adjacency_list.hpp>
9

    
10
using namespace std;
11

    
12
struct Router {
13
    string id;
14
    string name;
15

    
16
    Router() { };
17

    
18
    Router(string id, string name) : id(id), name(name) { }
19
};
20

    
21
struct Link {
22
    double cost;
23

    
24
    Link() { };
25

    
26
    Link(double cost) : cost(cost) { };
27
};
28

    
29
// List typedefs
30
typedef boost::adjacency_list<boost::listS, boost::listS, boost::undirectedS,
31
        Router, Link> Graph;
32
typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
33
typedef boost::graph_traits<Graph>::vertex_iterator Viter;
34

    
35
typedef boost::graph_traits<Graph>::edge_descriptor Edge;
36

    
37
#endif //GRAPH_PARSER_COMMON_H
38

    
39