Kea  1.9.9-git
isc::dns::rdata::AbstractRdataFactory Class Referenceabstract

The AbstractRdataFactory class is an abstract base class to encapsulate a set of Rdata factory methods in a polymorphic way. More...

#include <rrparamregistry.h>

+ Inheritance diagram for isc::dns::rdata::AbstractRdataFactory:

Public Member Functions

Factory methods for polymorphic creation.
virtual RdataPtr create (const std::string &rdata_str) const =0
 Create RDATA from a string. More...
 
virtual RdataPtr create (isc::util::InputBuffer &buffer, size_t rdata_len) const =0
 Create RDATA from wire-format data. More...
 
virtual RdataPtr create (const rdata::Rdata &source) const =0
 Create RDATA from another Rdata object of the same type. More...
 
virtual RdataPtr create (MasterLexer &lexer, const Name *origin, MasterLoader::Options options, MasterLoaderCallbacks &callbacks) const =0
 Create RDATA using MasterLexer. More...
 

Constructors and Destructor

 AbstractRdataFactory ()
 The default constructor. More...
 
virtual ~AbstractRdataFactory ()
 The destructor. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

isc::dns::rdata::AbstractRdataFactory::AbstractRdataFactory ( )
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.

virtual isc::dns::rdata::AbstractRdataFactory::~AbstractRdataFactory ( )
inlinevirtual

The destructor.

Definition at line 70 of file rrparamregistry.h.

Member Function Documentation

virtual RdataPtr isc::dns::rdata::AbstractRdataFactory::create ( const std::string &  rdata_str) const
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.

Parameters
rdata_strA string of textual representation of the Rdata.
Returns
An RdataPtr object pointing to the created Rdata object.

Implemented in isc::dns::RdataFactory< T >.

Referenced by isc::dns::RRParamRegistry::createRdata().

virtual RdataPtr isc::dns::rdata::AbstractRdataFactory::create ( isc::util::InputBuffer buffer,
size_t  rdata_len 
) const
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.

Parameters
bufferA reference to an InputBuffer object storing the Rdata to parse.
rdata_lenThe length in buffer of the Rdata. In bytes.
Returns
An RdataPtr object pointing to the created Rdata object.

Implemented in isc::dns::RdataFactory< T >.

virtual RdataPtr isc::dns::rdata::AbstractRdataFactory::create ( const rdata::Rdata source) const
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.

Parameters
sourceA reference to an Rdata object whose content is to be copied to the created Rdata object.
Returns
An RdataPtr object pointing to the created Rdata object.

Implemented in isc::dns::RdataFactory< T >.

virtual RdataPtr isc::dns::rdata::AbstractRdataFactory::create ( MasterLexer lexer,
const Name origin,
MasterLoader::Options  options,
MasterLoaderCallbacks callbacks 
) const
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 >.


The documentation for this class was generated from the following file: