[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1423db2d 1/4: Make a base class's special mem
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1423db2d 1/4: Make a base class's special members protected |
Date: |
Fri, 15 Jul 2022 22:21:57 -0400 (EDT) |
branch: master
commit 1423db2dedaee8591998332a7309aabedef40dcc
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};
};