diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2024-06-15 12:06:08 +0200 |
---|---|---|
committer | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2024-06-15 12:06:08 +0200 |
commit | 343dde975d25dba7d7c8737eaf94be7f3a17d7b9 (patch) | |
tree | 9ea8b1da58e5528610b4cd4e086bb6738c2bc17e | |
parent | f2b0ea746d71cececc638077bfd7f2f47e128c14 (diff) |
doxygen comments
-rw-r--r-- | Circuit.h | 5 | ||||
-rw-r--r-- | LoopDetection.h | 1 | ||||
-rw-r--r-- | Net.h | 2 | ||||
-rw-r--r-- | Node.h | 2 | ||||
-rw-r--r-- | Observer.h | 2 | ||||
-rw-r--r-- | SignalLevel.h | 2 | ||||
-rw-r--r-- | readme.md | 12 |
7 files changed, 19 insertions, 7 deletions
@@ -18,10 +18,15 @@ public: virtual ~Circuit(); public: + //! Auto-magically creates either a new node or net virtual void create(string label, vector<string> nodes); + //! Create new node (internal function) virtual void new_node(string label, string type); + //! Create new net (internal function) virtual void new_net(string src, vector<string> dests); + //! Simulate the circuit virtual void sim(); + //! Get simulation results (probe measure values) virtual string result(); private: diff --git a/LoopDetection.h b/LoopDetection.h index f12c83b..c25887e 100644 --- a/LoopDetection.h +++ b/LoopDetection.h @@ -10,6 +10,7 @@ public: LoopDetection() = default; virtual ~LoopDetection(); + //! Add connection and throws CircuitError if it creates a loop virtual void add_connection(const std::string &src, const std::vector<std::string> &dests); private: @@ -9,7 +9,9 @@ private: public: Net() = default; virtual ~Net() = default; + //! Updates level and notifies all attached observers (node) virtual void setLevel(SignalLevel); + //! Returns level value virtual SignalLevel getLevel(); }; @@ -21,7 +21,9 @@ public: void update(); virtual void addInput(Net *); virtual void setOutput(Net *); + //! validate and simulate virtual void sim(); + //! logical implementation of the node/gate virtual SignalLevel level() = 0; protected: @@ -10,9 +10,9 @@ class Subject { private: std::vector<Observer*> observers; public: - // virtual void attach(Observer* obs) { observers.push_back(obs);} virtual void attach(Observer* obs); virtual void detach(Observer*); + //! Get number of attached observers virtual int size(); virtual void notify(); diff --git a/SignalLevel.h b/SignalLevel.h index 81c7ff8..92b7232 100644 --- a/SignalLevel.h +++ b/SignalLevel.h @@ -2,6 +2,7 @@ #include <string> +//! Enum for signal values enum SignalLevel { LOW, HIGH, @@ -9,6 +10,7 @@ enum SignalLevel { }; namespace std { + //! convert enum to string std::string to_string(SignalLevel level); } @@ -19,7 +19,7 @@ make Functions: -- [ ] loop detection (JOSHUA) +- [x] loop detection (JOSHUA) - [x] final output format (LOEK) Schoonheid: @@ -28,7 +28,7 @@ Schoonheid: niet, moet in een constructor o.i.d. gedaan worden) - [ ] is de scope (public/private/protected) van alle members lekker consistent? -- [ ] stomme doxygen (`//! <korte beschrijving>` boven functies/variabelen, +- [x] stomme doxygen (`//! <korte beschrijving>` boven functies/variabelen, `//!< wat doet dit` bij enum constantes) Classes: @@ -38,12 +38,12 @@ Classes: - [x] class GateAnd - [x] class GateNand - [X] class GateNor -- [ ] class GateNot +- [x] class GateNot - [x] class GateOr -- [ ] class GateXor +- [x] class GateXor - [x] class Net -- [ ] class NodeInput -- [ ] class NodeOutput +- [x] class NodeInput +- [x] class NodeOutput - [x] class Parser - [x] class Subject - [x] enum SignalLevel |