]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2206] Add ZoneTableHeader::getTable() method
authorMukund Sivaraman <muks@isc.org>
Wed, 3 Oct 2012 04:28:04 +0000 (09:58 +0530)
committerMukund Sivaraman <muks@isc.org>
Wed, 3 Oct 2012 04:28:04 +0000 (09:58 +0530)
src/lib/datasrc/memory/zone_table_segment.h
src/lib/datasrc/tests/memory/zone_table_segment_unittest.cc

index 89389a5fba3579f8cdd717c5389eb5c9110c942e..6bf0d480a3f4d2f45d34d5a0c4f947944f53b287 100644 (file)
@@ -34,6 +34,18 @@ namespace memory {
 /// implementation. It contains an offset pointer to the zone table (a
 /// map from domain names to zone locators) in memory.
 struct ZoneTableHeader {
+public:
+    /// \brief Returns a pointer to the underlying zone table.
+    ZoneTable* getTable() {
+        return (table.get());
+    }
+
+    /// \brief const version of getTable().
+    const ZoneTable* getTable() const {
+        return (getTable());
+    }
+
+private:
     boost::interprocess::offset_ptr<ZoneTable> table;
 };
 
index 1dfe14341cac0009a4be076518299be75ccf3658..1313092b5992a473ea4005fd581e2d7f3145126c 100644 (file)
@@ -40,7 +40,7 @@ TEST(ZoneTableSegment, getHeader) {
     EXPECT_NE(static_cast<void*>(NULL), header);
 
     // The zone table is unset.
-    ZoneTable* table = header->table.get();
+    ZoneTable* table = header->getTable();
     EXPECT_EQ(static_cast<void*>(NULL), table);
 }