NanoTekSpice
DigitalElectronics
C4081.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2019
3 ** OOP_NanoTekSpice
4 ** File description:
5 ** C4081 class
6 */
7 
15 #ifndef C4081_HPP_
16  #define C4081_HPP_
17 
18 #include "IComponent.hpp"
19 #include "Component.hpp"
20 #include <iostream>
21 #include <string>
22 #include <map>
23 
29 {
30  public:
36  C4081();
40  ~C4081();
50  nts::Tristate compute(std::size_t pin = 1) override;
60  void setLink(std::size_t pin , nts::IComponent &other, std::size_t otherPin) final;
66  void dump() const noexcept override;
76  void setInput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final;
86  void setOutput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final;
87 
88  private:
97  void checkSelfLink(std::size_t pin1, std::size_t pin2);
106  nts::Tristate computeInput(nts::Pin &pin);
116  nts::Tristate computeOutput(nts::Door &door);
117 
118  std::map<size_t, nts::Door> _doors;
119 };
120 
121 #endif /* !C4081_HPP_ */
void setInput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set input link method.
Definition: C4081.cpp:149
Definition: IComponent.hpp:45
void dump() const noexcept override
Display information.
Definition: C4081.cpp:188
void setLink(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set link method.
Definition: C4081.cpp:104
Definition: Component.hpp:19
void setOutput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set output link method.
Definition: C4081.cpp:173
~C4081()
Component 4081 Destructor.
Definition: C4081.cpp:36
Quad 2-input AND gate.
Definition: C4081.hpp:28
C4081()
Component 4081 Constructor.
Definition: C4081.cpp:12
Definition: IComponent.hpp:18
nts::Tristate compute(std::size_t pin=1) override
Compute.
Definition: C4081.cpp:66
Definition: IComponent.hpp:52