[bind10-dev] RRsets and polymorphism

Evan Hunt each at isc.org
Fri Feb 26 07:40:02 UTC 2010


I wanted to note a conflict that came up during the each-ds merge.

Previously in trunk RRsetPtr was a shared_ptr<AbstractRRset>, BasicRRset
was a concrete derived class, and RRset was a typedef for BasicRRset.

One of the new features in each-ds, however, is an "RRset" class, that
contains a pointer to a second RRset containing signatures.  There are new
methods added to this derived class--addRRsig(), getRRsig(), removeRRsig().

I was not able to call these functions using an RRsetPtr because it
wouldn't give me access to anything not defined in AbstractRRset.  As a
workaround I changed RRsetPtr to shared_ptr<RRset>, but I imagine there's
probably a more suitable C++ way to do that.  Part of the reason I mention
it now is to make sure we don't forget to fix this.

However, it seems to me that the *best* way to fix it would be to do away
with the distinction between BasicRRset and RRset entirely, and put
addRRsig(), etc, into the API defined by AbstractRRset.

My question:  Do we need polymorphism with respect to RRsets?  I'm not
seeing an obvious use case for it at the moment.

                                        eh




More information about the bind10-dev mailing list