-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.h
52 lines (38 loc) · 1.11 KB
/
Node.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
51
/*
* File: Node.h
* Author: JC and VB
* Author: TSA
*
* Updated on August 24, 2016, 01:40 PM
* Created on October 6, 2013, 12:58 PM
*/
#ifndef NODE_H
#define NODE_H
#define MAX_RESISTORS_PER_NODE 5
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
class Node
{
private:
int numRes=0; // number of resistors currently connected
int resIDArray[MAX_RESISTORS_PER_NODE]; // stores the index of each resistor connected
public:
Node();
~Node();
// Checks to see if the resistor can be added to poistion rIndex
// in the resistor array. Returns true if yes, otherwise false.
bool canAddResistor(int rIndex);
// Updates resIDArray to make the resistor in position rIndex in
// the resistor array connected to this node.
void addResistor (int rIndex);
// prints the whole node
// nodeIndex is the position of this node in the node array.
void print (int nodeIndex);
//gets id of resistor
int getResIDArray(int index) const;
//returns number of resistors connected currently
int numResConnected() const;
};
#endif /* NODE_H */