-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPin.hpp
57 lines (49 loc) · 1.03 KB
/
Pin.hpp
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
52
53
54
55
56
57
#ifndef PIN_HPP_
# define PIN_HPP_
# include <string>
# include <iostream>
#include "IComponent.hpp"
#include "Error.hpp"
namespace nts
{
class Pin
{
public:
enum Mode
{
U = 0,
I,
O,
IO,
VSS,
VDD
};
public:
Pin(Mode = U);
Pin(const Pin &);
~Pin();
const Pin &operator=(const Pin &);
public:
void setComponent(IComponent &);
void setTarget(std::size_t);
void setState(Tristate);
void setMode(Mode);
void setCalc(int);
bool isLinked() const;
IComponent &getComponent() const;
std::size_t getTargetPin() const;
Tristate getState() const;
int getReset() const;
Mode getMode() const;
public:
nts::Tristate compute();
private:
Mode mode;
nts::IComponent *component;
int calculating;
int to_reset;
Tristate state;
std::size_t target_pin;
};
}
#endif