@startuml abstract class Node { /' (also ConcreteObserver) '/ + setOutput(Net*) + addInput(Net*) - inputs: Net*[] - output: Net* - type: static constexpr const string - minInputs: constexpr unsigned int - maxInputs: constexpr int } class Net { /' (also ConcreteSubject) '/ - level: SignalLevel + setLevel(SignalLevel) ' only call notify when setLevel actually changes the level!!!!!!! } class Subject { - observers: Observer*[] + attach(Observer*) + detach(Observer*) + notify() } interface Observer { + update() } class GateAnd class GateNand class GateNor class GateNot class GateOr class GateXor class NodeOutput class NodeInput enum SignalLevel { LOW HIGH UNDEFINED } Node <|-[dashed]-- GateAnd Node <|-[dashed]-- GateNand Node <|-[dashed]-- GateNor Node <|-[dashed]-- GateNot Node <|-[dashed]-- GateOr Node <|-[dashed]-- GateXor Node <|-[dashed]-- NodeOutput Node <|-[dashed]-- NodeInput Subject <|-- Net Observer <|-[dashed]- Node Node -> "owner" Net Observer "*" - Subject class Parser { + loadFromFile() } class CircuitFactory { + run() + configure() } class Circuit { + createNode(string type, string label) + createLink(string labelA, string labelB) - nets: Map - nodes: Map } CircuitFactory -[dashed]> Node CircuitFactory <-[dashed]- Node @enduml