BIND 10 #310: proposal: constify lib/cc API more appropriately

BIND 10 Development do-not-reply at isc.org
Mon Aug 16 22:55:50 UTC 2010


#310: proposal: constify lib/cc API more appropriately
----------------------------+-----------------------------------------------
  Reporter:  jinmei         |            Owner:  jinmei              
      Type:  enhancement    |           Status:  new                 
  Priority:  minor          |        Milestone:  y2 6 month milestone
 Component:  configuration  |         Keywords:                      
 Sensitive:  0              |   Estimatedhours:  0                   
     Hours:  0              |         Billable:  1                   
Totalhours:  0              |         Internal:  0                   
----------------------------+-----------------------------------------------
 I've been noticing (but haven't had time to address) that constness of
 isc::data::ElementPtr could be improved in many points:
  - at the very least, I suspect the usage of 'const !ElementPtr' is quite
 unlikely to be what was actually intended.  I guess it was intended to be
 a shared_ptr version of 'const Element*', which is actually be
 'shared_ptr<const Element>' (which I'd name '!ConstElementPtr'), not
 'const shared_ptr<Element>'.
  - assuming the first point is correct, if we change 'const !ElementPtr'
 to '!ConstElementPtr', it would be clearer that many of the usage is
 actually read-only and many other !ElementPtr can be changed to
 !ConstElementPtr
  - after doing this, we can change many method functions to const member
 functions.

 Without these changes the code can work correctly, but since this API is
 quite complicated I think we can greatly benefit from making things const
 as much as possible.  One typical benefit is that we could avoid
 introducing a bug that the content of an !ElementPtr is magically modified
 at some deep level of API.

 I've finally managed to make these changes, and am going to make a
 separate branch to get the proposed change reviewed.

-- 
Ticket URL: <http://bind10.isc.org/ticket/310>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list