Commit c049a836 authored by David G Andersen's avatar David G Andersen
Browse files

Added numnodes()

parent 5652b392
......@@ -28,6 +28,13 @@ tbswitch::~tbswitch() {
nodecount = 0;
}
inline int tbswitch::numnodes() {
int nc = 0;
for (int i = 0; i < nodecount; i++)
nc += nodes[i].count;
return nc;
}
topology::topology(int nswitches) {
switchcount = nswitches;
switches = new tbswitch *[switchcount];
......
......@@ -12,6 +12,9 @@ public:
virtual ~tbswitch();
tbswitch(int ncount, char *newname); // Specify number of toponodes
void setsize(int ncount);
inline int numnodes();
int nodecount;
toponode *nodes;
char *name;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment