virtual.h 1.2 KB
Newer Older
1 2 3
#ifndef __VIRTUAL_H
#define __VIRTUAL_H

4 5
class tb_vnode {
public:
6 7 8 9 10 11 12 13 14 15 16 17
  tb_vnode() {;}
  friend ostream &operator<<(ostream &o, const tb_vnode& node)
    {
      o << "TBVNode: " << node.name << endl;
      return o;
    }
  
  friend istream &operator>>(istream &i, const tb_vnode& node)
    {
      return i;
    }

18 19 20 21 22 23
  int posistion;		// index into pnode array
  int no_connections;		// how many unfulfilled connections from this node
  nodeType type;		// type of the node
  char *name;			// string name of the node
};

24
typedef enum {LINK_DIRECT,LINK_INTRASWITCH,LINK_INTERSWITCH} tb_link_type;
25 26 27 28 29

class tb_plink;

class tb_vlink {
public:
30 31 32 33 34 35 36 37 38 39
  tb_vlink() {;}
  friend ostream &operator<<(ostream &o, const tb_vlink& edge)
    {
      o << "unimplemeted ostream << for tb_vlink " << endl;
      return o;
    }
  friend istream & operator>>(istream &i, const tb_vlink& edge)
    {
      return i;
    } 
40 41 42 43 44 45 46 47 48 49
  typedef enum {LINK_UNKNOWN, LINK_DIRECT,
	LINK_INTRASWITCH, LINK_INTERSWITCH} linkType;
  
  int bandwidth;		// how much bandwidth this uses
  linkType type;		// link type
  edge plink;			// plink this belongs to
  edge plink_two;		// second plink for INTRA and INTER links
};

typedef GRAPH<tb_vnode,tb_vlink> tb_vgraph;
50 51

#endif