[bind10-dev] Minor things about the master loader
JINMEI Tatuya / 神明達哉
jinmei at isc.org
Mon Nov 5 18:45:57 UTC 2012
At Mon, 5 Nov 2012 18:25:39 +0100,
Michal 'vorner' Vaner <michal.vaner at nic.cz> wrote:
>
> [1 <multipart/signed (7bit)>]
> [1.1 <text/plain; utf-8 (quoted-printable)>]
> Hello
>
> I have two questions about the currently being developed master loader.
> • Should we move it to a separate sub-namespace and directory
> (isc::dns::master_load)? There seems to be some number of classes already.
If you mean master_lexer_internal, it's a hack for hiding internal
details as much as possible while they can be still tested (other than
for tests we'd rather even hide them as a private and/or through
pimpl). For public classes like MasterLoader, at least it was not the
original intend to introduce a separate namespace just for that.
> Also, the proposals seem to suggest there's a need for one ‒ for example
> #2376 suggests the struct Callbacks be part of dns::MasterLoader. But it
> could also be part of something else, like MasterLoaderContextBase. So I
> think we should put them on the same level (or all part of MasterLoader).
The background reason for separating the callback class/struct is to
allow it to be used in rdata classes independently (as noted in
#2376). Wherever place is okay as long as we can reasonably achieve
the goal. But looking at it again, I now think neither MasterLoader
nor MasterLoaderContext is a good place, because we'd then need to
make rdata classes rely on the concept of master loader. It seems to
be awkward in that more primitive classes depend on higher level
concepts.
> • The InputSource provides line number only. But the API design suggests we
> should pass line number and byte offset in the file with errors and warnings.
> Should the master loader/lexer/whatever count the bytes as it calls
> inputSource.getChar() or should this function be added to the input source?
(in my memory) I though we'd like to have the byte count so we can
implement the progress bar in the loadzone-ng (we could use line
numbers, but to do so we need the total number of lines beforehand,
which is not easy to count). For that purpose the best place to do
should be InputSource because that's the class that knows where
exactly we are in the input file (or stream).
---
JINMEI, Tatuya
Internet Systems Consortium, Inc.
More information about the bind10-dev
mailing list