Parcourir la source

added clarification comments on constness

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1107 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya il y a 15 ans
Parent
commit
7a4a0c9c93
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      src/lib/auth/cpp/query.h

+ 7 - 1
src/lib/auth/cpp/query.h

@@ -183,7 +183,13 @@ public:
     const isc::dns::RRClass& qclass() const { return *qclass_; }
     const isc::dns::RRType& qtype() const { return *qtype_; }
 
-    isc::dns::Message& message() const { return *message_; }
+    // Note: these can't be constant member functions because they expose
+    // writable 'handles' of internal member variables.  It's questionable
+    // whether we need these accessors in the first place because the
+    // corresponding members are public (which itself is not a good practice
+    // but it's a different topic), but at the moment we keep them.
+    // We should definitely revisit the design later.
+    isc::dns::Message& message() { return *message_; }
     QueryTaskQueue& tasks() { return querytasks_; }
 
     Status status() const { return status_; }