BIND 10 #2497: introduce wrapper version of "from lexer" rdata factory
BIND 10 Development
do-not-reply at isc.org
Wed Nov 21 02:32:22 UTC 2012
#2497: introduce wrapper version of "from lexer" rdata factory
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | UnAssigned
Priority: medium | Status: new
Component: libdns++ | Milestone: New
Sensitive: 0 | Tasks
Sub-Project: DNS | Keywords:
Estimated Difficulty: 0 | Defect Severity: N/A
Total Hours: 0 | Feature Depending on Ticket:
| loadzone-ng
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
This task is to introduce an intermediate wrapper so that we can use
the "from master lexer" Rdata factory transparently, until we complete
supporting all currently defined Rdata's. The basic idea is to
forward the work to the existing "from string" factory by default, and
use the dedicated versions as we implement those RR types of Rdata.
Specifically:
- introduce `AbstractRdataFactory::create(lexer)`:
{{{#!cpp
class AbstractRdataFactory {
virtual RdataPtr create(MasterLexer& lexer, const Name* origin,
MasterLoader::Option options,
MasterLoader::Callbacks& callbacks) const;
};
}}}
and define the default version of it (unlike other create() methods
we need the default version for the moment). It will use the lexer
to get all token until EOL or EOF as strings, concatenate them
separated by a space into a single std::string object, and then
call this version of create():
{{{#!cpp
virtual RdataPtr create(const std::string& rdata_str) const = 0;
}}}
- update rrparamregistry-placeholder.cc as follows:
- rename current `RdataFactory` to `OldRdataFactory`. for the "from
lexer" create() method, it will use the default version.
- introduce a new `RdataFactory`, which has the "from lexer" create
method:
{{{#!cpp
virtual RdataPtr create(MasterLexer& lexer, const Name* origin,
MasterLoader::Option options,
MasterLoader::Callbacks& callbacks) const
{
return (RdataPtr(new T(dynamic_cast<const T&>(lexer, origin,
options,
callbacks))));
}
}}}
- update gen-rdatacode.py:generate_rrparam() so that, except for
hardcoded exceptions, use `OldRdataFactory` instead of `RdataFactory`.
we update the exception list as we implement RDATAs
--
Ticket URL: <http://bind10.isc.org/ticket/2497>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list