]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2206] Make constructors protected
authorMukund Sivaraman <muks@isc.org>
Wed, 3 Oct 2012 05:19:01 +0000 (10:49 +0530)
committerMukund Sivaraman <muks@isc.org>
Wed, 3 Oct 2012 05:19:01 +0000 (10:49 +0530)
src/lib/datasrc/memory/zone_table_segment.h
src/lib/datasrc/memory/zone_table_segment_local.h

index 85050196f5c8206208bb0c26848aea1b31433750..ca7b9d2f22f80f25904909ce4e13130d02755dc3 100644 (file)
@@ -58,6 +58,14 @@ private:
 /// management implementation. Derived classes would implement the
 /// interface for specific memory-implementation behavior.
 class ZoneTableSegment {
+protected:
+    /// \brief Protected constructor
+    ///
+    /// An instance implementing this interface is expected to be
+    /// created by the factory method (\c create()), so this constructor
+    /// is protected.
+    ZoneTableSegment()
+    {}
 public:
     /// \brief Destructor
     virtual ~ZoneTableSegment() {}
index 6d823a7d8e7995e92b02a59f22316dc32fae5931..45a5b5fd1611acdf69b34a66480537ed2aa33572 100644 (file)
@@ -28,6 +28,17 @@ namespace memory {
 /// MemorySegmentLocal based ZoneTableSegment. Please see the
 /// ZoneTableSegment class documentation for usage.
 class ZoneTableSegmentLocal : public ZoneTableSegment {
+    // This is so that ZoneTableSegmentLocal can be instantiated from
+    // ZoneTableSegment::create().
+    friend class ZoneTableSegment;
+protected:
+    /// \brief Protected constructor
+    ///
+    /// Instances are expected to be created by the factory method
+    /// (\c ZoneTableSegment::create()), so this constructor is
+    /// protected.
+    ZoneTableSegmentLocal()
+    {}
 public:
     /// \brief Destructor
     virtual ~ZoneTableSegmentLocal() {}