Initial circuit.

This commit is contained in:
James Grogan 2023-01-03 07:47:49 +00:00
parent ab3ffc77dc
commit 1dfbcc61c4

View file

@ -3,19 +3,58 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
class Terminal class CircuitElement
{ {
}; };
class Terminal : public CircuitElement
{
public:
enum class Type
{
INPUT,
OUTPUT
};
Terminal(Type type)
: mType(type)
{
}
private:
double mValue{0};
Type mType;
};
class Wire class Wire
{ {
public:
Wire(CircuitElement* input, CircuitElement* output)
: mInput(input),
mOutput(output)
{
}
private:
CircuitElement* mInput{nullptr};
CircuitElement* mOutput{nullptr};
}; };
class LogicGate class LogicGate
{ {
public:
enum class Type
{
NOT,
AND,
OR,
XOR,
};
}; };
class ElectronicCircuit class ElectronicCircuit