Kea 2.7.5
|
The AbstractRdataFactory
class is an abstract base class to encapsulate a set of Rdata factory methods in a polymorphic way.
More...
#include <rrparamregistry.h>
Public Member Functions | |
Factory methods for polymorphic creation. | |
virtual RdataPtr | create (const std::string &rdata_str) const =0 |
Create RDATA from a string. | |
virtual RdataPtr | create (isc::util::InputBuffer &buff, size_t rdata_len) const =0 |
Create RDATA from wire-format data. | |
virtual RdataPtr | create (const rdata::Rdata &source) const =0 |
Create RDATA from another Rdata object of the same type. | |
virtual RdataPtr | create (MasterLexer &lexer, const Name *origin, MasterLoader::Options options, MasterLoaderCallbacks &callbacks) const =0 |
Create RDATA using MasterLexer. | |
Constructors and Destructor | |
AbstractRdataFactory () | |
The default constructor. | |
virtual | ~AbstractRdataFactory () |
The destructor. | |
The AbstractRdataFactory
class is an abstract base class to encapsulate a set of Rdata factory methods in a polymorphic way.
An external developer who wants to introduce a new or experimental RR type is expected to define a corresponding derived class of AbstractRdataFactory
and register it via RRParamRegistry
.
Other users of this API normally do not have to care about this class or its derived classes; this class is generally intended to be used as an internal utility of the API implementation.
Definition at line 57 of file rrparamregistry.h.
|
inlineprotected |
The default constructor.
This is intentionally defined as protected
as this base class should never be instantiated (except as part of a derived class).
Definition at line 67 of file rrparamregistry.h.
|
inlinevirtual |
The destructor.
Definition at line 70 of file rrparamregistry.h.
|
pure virtual |
Create RDATA from another Rdata
object of the same type.
This method creates an Rdata
object of specific class corresponding to the specific derived class of AbstractRdataFactory
, copying the content of the given Rdata
, source
.
source
must be an object of the concrete derived class corresponding to the specific derived class of AbstractRdataFactory
; otherwise, an exception of class std::bad_cast
will be thrown.
source | A reference to an Rdata object whose content is to be copied to the created Rdata object. |
RdataPtr
object pointing to the created Rdata
object. Implemented in isc::dns::RdataFactory< T >.
|
pure virtual |
Create RDATA from a string.
This method creates from a string an Rdata
object of specific class corresponding to the specific derived class of AbstractRdataFactory
.
rdata_str | A string of textual representation of the Rdata . |
RdataPtr
object pointing to the created Rdata
object. Implemented in isc::dns::RdataFactory< T >.
Referenced by isc::dns::RRParamRegistry::createRdata(), isc::dns::RRParamRegistry::createRdata(), isc::dns::RRParamRegistry::createRdata(), and isc::dns::RRParamRegistry::createRdata().
|
pure virtual |
Create RDATA from wire-format data.
This method creates from wire-format binary data an Rdata
object of specific class corresponding to the specific derived class of AbstractRdataFactory
.
buff | A reference to an InputBuffer object storing the Rdata to parse. |
rdata_len | The length in buffer of the Rdata . In bytes. |
RdataPtr
object pointing to the created Rdata
object. Implemented in isc::dns::RdataFactory< T >.
|
pure virtual |
Create RDATA using MasterLexer.
This version of the method defines the entry point of factory of a specific RR type and class for RRParamRegistry::createRdata()
that uses MasterLexer
. See its description for the expected behavior and meaning of the parameters.
Implemented in isc::dns::RdataFactory< T >.