From 42a564bb911618980083b9f13931d8422927a2fb Mon Sep 17 00:00:00 2001 From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> Date: Sun, 16 Jun 2024 09:41:19 +0200 Subject: Nand fixed --- GateNand.cpp | 8 ++++---- GateNand.h | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/GateNand.cpp b/GateNand.cpp index 5e43618..2d4d9c6 100644 --- a/GateNand.cpp +++ b/GateNand.cpp @@ -2,7 +2,7 @@ GateNand GateNand::instance(GateNand::type); -GateNand::GateNand(const char * type) : GateAnd(type) { } +// GateNand::GateNand(const char * type) : GateAnd(type) { } SignalLevel GateNand::level() { SignalLevel lvl = GateAnd::level(); @@ -13,7 +13,7 @@ SignalLevel GateNand::level() { // GateNand::GateNand(const GateNand * prototype) : GateAnd() { } -// GateNand * GateNand::clone() const { -// return new GateNand(this); -// } +GateNand * GateNand::clone() const { + return new GateNand(this); +} diff --git a/GateNand.h b/GateNand.h index 5ed9956..fb9d788 100644 --- a/GateNand.h +++ b/GateNand.h @@ -4,13 +4,16 @@ #include "GateAnd.h" class GateNand : public GateAnd { - using GateAnd::GateAnd; +public: + virtual GateNand * clone() const; protected: SignalLevel level(); + using GateAnd::GateAnd; private: - GateNand(const char * type); + GateNand(const GateNand *) : GateAnd() {} + // GateNand(const char * type); constexpr static const char * type = "nand"; static GateNand instance; }; -- cgit v1.2.3