[bind10-dev] OpenReg's communications framework

Shane Kerr shane at isc.org
Wed Jul 22 10:25:45 UTC 2009


Michael,

On Mon, 2009-07-13 at 17:51 -0500, Michael Graff wrote:
> Francis Dupont wrote:
> >> An "item" is either a literal string of bytes, a NULL, a HASH, or a LIST.
> > 
> > => is there a notion of pointer? This is needed to express sharing,
> > for instance for data structures like cyclic graphs. Without it not
> > only some data structures have an infinite representation but it can
> > be very inefficient. Perhaps it is coded with a dictionary of shared
> > items?
> 
> OpenReg did not need such things.  We lived in a world of database
> tables, so storing a name of a zone or its zone_id was enough to
> reference a shared object.
> 
> I could see a way to do this without any magic.  If you expect a node
> named "parent" to be either a parent object (that is, a "hash"
> describing the object) but get an integer, that references an object
> with an id you already got.

Alternately we could use the Python "pickle" format which supports
circular references (among other things). It's trivial to use in Python:

        import pickle
        
        data1 = [ "alpha", "beta", ]
        data2 = [ data1, ]
        data1.append(data2)
        
        f = open("xxx", "w")
        pickle.dump(data1, f)
        
And there appears to be Boost support:

        http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/pickle.html

So we can serialize C++ objects as needed.

May be useful as a data format if we layer on top of XMPP.

--
Shane




More information about the bind10-dev mailing list