[svn] commit: r2299 - in /branches/trac192/src/lib/datasrc: cache.cc cache.h

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jun 28 01:33:21 UTC 2010


Author: jinmei
Date: Mon Jun 28 01:33:21 2010
New Revision: 2299

Log:
cleanups:
 - remove or move to .cc implementation-specific header files
 - constify
 - removed unnecessary member variable

Modified:
    branches/trac192/src/lib/datasrc/cache.cc
    branches/trac192/src/lib/datasrc/cache.h

Modified: branches/trac192/src/lib/datasrc/cache.cc
==============================================================================
--- branches/trac192/src/lib/datasrc/cache.cc (original)
+++ branches/trac192/src/lib/datasrc/cache.cc Mon Jun 28 01:33:21 2010
@@ -13,6 +13,15 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 // $Id$
+
+#include <stdint.h>
+
+#include <map>
+
+#include <dns/question.h>
+#include <dns/rrclass.h>
+#include <dns/rrset.h>
+#include <dns/rrtype.h>
 
 #include <datasrc/cache.h>
 
@@ -393,13 +402,13 @@
 
 /// Enable or disable the cache
 void
-HotCache::setEnabled(bool e) {
+HotCache::setEnabled(const bool e) {
     impl_->enabled_ = e;
 }
 
 /// Indicate whether the cache is enabled
 bool
-HotCache::getEnabled() {
+HotCache::getEnabled() const {
     return (impl_->enabled_);
 }
 

Modified: branches/trac192/src/lib/datasrc/cache.h
==============================================================================
--- branches/trac192/src/lib/datasrc/cache.h (original)
+++ branches/trac192/src/lib/datasrc/cache.h Mon Jun 28 01:33:21 2010
@@ -18,17 +18,18 @@
 #define __CACHE_H
 
 #include <time.h>
-#include <map>
 
 #include <boost/shared_ptr.hpp>
 
-#include <dns/name.h>
-#include <dns/message.h>
-#include <dns/rrtype.h>
-#include <dns/rrclass.h>
 #include <dns/rrset.h>
 
 namespace isc {
+namespace dns {
+class Name;
+class RRClass;
+class RRType;
+}
+
 namespace datasrc {
 
 class CacheNode;
@@ -200,7 +201,7 @@
     void setEnabled(bool e);
 
     /// \brief Indicate whether the cache is enabled
-    bool getEnabled();
+    bool getEnabled() const;
 
     /// \brief Returns the number of nodes currently stored in the cache.
     ///
@@ -212,9 +213,6 @@
 private:
     /// \brief Hidden implementation details
     HotCacheImpl* impl_;
-
-    /// \brief True if cache is enabled (set to true by default)
-    bool enabled_;
 };
 
 }




More information about the bind10-changes mailing list