-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.h
39 lines (36 loc) · 812 Bytes
/
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
#ifndef NODE_H
#define NODE_H
#include "Resistor.h"
#include "ResistorList.h"
class Node
{
private:
int id;
double voltage;
bool set;
ResistorList rl;
Node *prev,*next;
public:
Node(int id_);
Node(int id_, double voltage_, bool set_, Node *prev_, Node *next_);
~Node();
void addResistor(Resistor* r);
int getID();
Node* getNext();
Node* getPrev();
void setPrev(Node *prev_);
void setNext(Node *next_);
void setV(double voltage_);
void forceSet();
void unsetV();
bool isSet();
int* getOtherNodes();
double* getResistors();
double inverseSum();
double getV();
double modifyR(string name, double r);
void deleteR(string name);
Resistor* getR(string name);
void print();
};
#endif /* NODE_H */