BIND 10 #172: cc channel - use JSON

BIND 10 Development do-not-reply at isc.org
Mon Jun 28 17:38:14 UTC 2010


#172: cc channel - use JSON
----------------------+-----------------------------------------------------
 Reporter:  larissas  |        Owner:  jelte                                         
     Type:  task      |       Status:  reviewing                                     
 Priority:  major     |    Milestone:  05. 3rd Incremental Release: Serious Secondary
Component:  msgq      |   Resolution:                                                
 Keywords:            |    Sensitive:  0                                             
----------------------+-----------------------------------------------------
Changes (by stephen):

  * owner:  stephen => jelte


Comment:

 >> __src/lib/cc/data.h__
 >> Remark: The choice of constants for the "types" enum: the names
 "string", "list"
 >> and "map" - although aptly named - could be confused with type
 declarations.
 >> Leave for now, but perhaps change in the future?
 >
 > If you have suggestions, i'd gladly hear them, I also had the plan of
 renaming
 > the namespace (data), which has a related problem, so we can nicely fit
 that into
 > one ticket :)

 How about STRING, LIST and MAP? (Together with INTEGER, DOUBLE, NONE etc.)


 >> __src/lib/cc/data.cc__
 >> count_chars_i()
 >> from_stringstream_number()
 >> :
 > doh, fixed (keep dividing until < 1, i'm thinking there's a more
 efficient way for this :)

 In the code for reading characters from the string, how about reading the
 next string token from the stream then using boost::lexical_cast to
 convert it to a number?  That way you can attempt to cast it to an int
 and, if it throws a bad_lexical_cast exception, try casting it to a
 double.


 __src/lib/cc/data_unittests.cc__
 Question about the code being tested: I note that if an object containing
 (say) the name/value pair '"a" : 1' is merged into an object containing
 the pair '"a" : 2', the result is an object containing the pair '"a" : 2',
 i.e. the result is the value from the target.  But if it is merged into an
 object containing '"a" : null', the result does not contain "a" at all.
 Is this the desired behaviour? (i.e. why does the result not contain '"a"
 : null'?)


 __src/lib/config/module_spec.cc__
 >> General: this file contains a "getType_string()" function that returns
 a string
 >> representation of the Element::types enum, and a getTypes_value()
 function that
 >> does the inverse. These functions would be better made static methods
 of the the
 >> Element class. (They have got out of sync with the class; there is no
 translation
 >> for the "null" type.)
 >
 > ok done, renamed them to nameToType and typeToName though

 module_spec.cc still needs to be updated to call them.

-- 
Ticket URL: <http://bind10.isc.org/ticket/172#comment:11>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list