From 37f89ed05f64f5d4ab3883713e42c476f38ab6c0 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 17 Apr 2024 11:17:53 +0200 Subject: add WIP class diagram --- docs/.gitignore | 1 + docs/class-diag.puml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/class-diag.puml (limited to 'docs') diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..756b22f --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +*.svg diff --git a/docs/class-diag.puml b/docs/class-diag.puml new file mode 100644 index 0000000..fc4cafd --- /dev/null +++ b/docs/class-diag.puml @@ -0,0 +1,49 @@ +@startuml + +abstract class Node { /' (also ConcreteObserver) '/ + + update() +} +class Net { /' (also ConcreteSubject) '/ + + setLevel(SignalLevel level) +} + +class Subject { + + attach(Observer* observer) + + detach(Observer* 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 + + +@enduml -- cgit v1.2.3