NanoTekSpice
DigitalElectronics
C4514.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2019
3 ** OOP_NanoTekSpice
4 ** File description:
5 ** C4514 class
6 */
7 
15 #ifndef C4514_HPP_
16  #define C4514_HPP_
17 
18 #include "IComponent.hpp"
19 #include "Component.hpp"
20 #include <iostream>
21 #include <string>
22 #include <map>
23 
29 {
30  public:
36  C4514();
40  ~C4514();
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::Pin &pin);
117 
118  std::map<size_t, nts::Pin> _inputs;
119  std::map<size_t, nts::Pin> _outputs;
120 };
121 
122 #endif /* !C4514_HPP_ */
Definition: IComponent.hpp:45
void setLink(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set link method.
Definition: C4514.cpp:114
Definition: Component.hpp:19
4-Bit Latched/4-to-16 Line Decoders
Definition: C4514.hpp:28
~C4514()
Component 4514 Destructor.
Definition: C4514.cpp:41
void dump() const noexcept override
Display information.
Definition: C4514.cpp:182
Definition: IComponent.hpp:18
void setInput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set input link method.
Definition: C4514.cpp:150
C4514()
Component 4514 Constructor.
Definition: C4514.cpp:13
nts::Tristate compute(std::size_t pin=1) override
Compute.
Definition: C4514.cpp:87
void setOutput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set output link method.
Definition: C4514.cpp:167