physical.h 1.2 KB
Newer Older
1 2 3
#ifndef __PHYSICAL_H
#define __PHYSICAL_H

4 5
class tb_pnode {
public:
6
  tb_pnode() {;}
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  friend ostream &operator<<(ostream &o, const tb_pnode& node)
    {
      o << "TBNode: " << node.name << endl;
      return o;
    }
  
  friend istream &operator>>(istream &i, const tb_pnode& node)
    {
      return i;
    }
  
  tb_type types[MAX_TYPES];	// array of types, with counts of max
  nodeType current_type;	// the current type of the node
  int max_load;			// maxmium load for current type
  int current_load;		// how many vnodes are assigned to this pnode
  char *name;
  node the_switch;		// the switch the node is attached to
  int pnodes_used;		// for switch nodes
};

class tb_plink {
public:
29
  tb_plink() {;}
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  friend ostream &operator<<(ostream &o, const tb_plink& edge)
    {
      o << "unimplemeted ostream << for tb_plinke " << endl;
      return o;
    }
  friend istream & operator>>(istream &i, const tb_plink& edge)
    {
      return i;
    }  
  int bandwidth;		// maximum bandwidth of this link
  int bw_used;			// how much is used
  int users;			// number of users in direct links
};

class tb_route {
public:
private:
  int length;
  list<tb_plink> links;
};

typedef GRAPH<tb_pnode,tb_plink> tb_pgraph;
52 53

#endif