lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/abstract_base 1e005de3 1/3: Make a base class's


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/abstract_base 1e005de3 1/3: Make a base class's special members protected
Date: Thu, 14 Jul 2022 19:54:33 -0400 (EDT)

branch: odd/abstract_base
commit 1e005de37834b8072329bac72844468710cb4a56
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Make a base class's special members protected
---
 datum_base.hpp | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/datum_base.hpp b/datum_base.hpp
index 8bebc63f..53511fc2 100644
--- a/datum_base.hpp
+++ b/datum_base.hpp
@@ -28,23 +28,28 @@
 
 #include <iosfwd>
 
+/// Base class for GUI input fields.
+///
+/// Special member functions are protected simply because no need has
+/// arisen for them to be public.
+
 class LMI_SO datum_base
 {
   public:
-    datum_base() = default;
+    void enable(bool);
+    bool is_enabled() const;
+
+    virtual std::istream& read (std::istream&)       = 0;
+    virtual std::ostream& write(std::ostream&) const = 0;
 
+  protected:
+    datum_base() = default;
     datum_base(datum_base const&) = default;
     datum_base(datum_base&&) = default;
     datum_base& operator=(datum_base const&) = default;
     datum_base& operator=(datum_base&&) = default;
     virtual ~datum_base() = default;
 
-    void enable(bool);
-    bool is_enabled() const;
-
-    virtual std::istream& read (std::istream&)       = 0;
-    virtual std::ostream& write(std::ostream&) const = 0;
-
   private:
     bool enabled_ {true};
 };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]