te::xml::AbstractWriterFactory Class Referenceabstract

This is the abstract factory for XML writers. More...

#include <AbstractWriterFactory.h>

Inheritance diagram for te::xml::AbstractWriterFactory:
te::common::AbstractFactory< te::xml::AbstractWriter, std::string > te::xerces::WriterFactory

Public Types

typedef FactoryDictionary< AbstractFactory< te::xml::AbstractWriter, std::string, std::less< std::string > >, std::string, std::less< std::string > > dictionary_type
 
typedef AbstractFactory factory_type
 

Public Member Functions

const std::string & getKey () const
 It returns the factory key associated to the concreate factory. More...
 
virtual ~AbstractWriterFactory ()
 Virtual destructor. More...
 

Static Public Member Functions

static const factory_typefind (const std::string &factoryKey)
 
static dictionary_typegetDictionary ()
 It returns a reference to the internal dictionary of concrete factories. More...
 
static te::xml::AbstractWritermake ()
 It creates a new XML writer using the dafault implementation. More...
 
static te::xml::AbstractWritermake (const std::string &writerType)
 It creates a new XML writer. More...
 
static void setDefaultWriter (const std::string &writerType)
 It sets the default driver used to create the XML writer objects. More...
 

Protected Member Functions

 AbstractWriterFactory (const std::string &factoryKey)
 It creates the factory. More...
 
virtual te::xml::AbstractWriterbuild ()=0
 Concrete factories (derived from this one) must implement this method in order to create objects. More...
 

Protected Attributes

std::string m_factoryKey
 The key that identifies the concrete factory: it will be used for unregistering the factory during destruction. More...
 

Static Private Attributes

static std::string sm_defaultWriterType
 The type of the writer to be created if no type is informed. More...
 

Detailed Description

This is the abstract factory for XML writers.

This is an abstract factory, so you will need to call the static method make as follow:

or

// for a default writer
See also
Writer

Definition at line 64 of file AbstractWriterFactory.h.

Member Typedef Documentation

typedef FactoryDictionary<AbstractFactory<te::xml::AbstractWriter , std::string , std::less<std::string > >, std::string , std::less<std::string > > te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::dictionary_type
inherited

Definition at line 73 of file AbstractFactory.h.

typedef AbstractFactory te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::factory_type
inherited

Definition at line 77 of file AbstractFactory.h.

Constructor & Destructor Documentation

virtual te::xml::AbstractWriterFactory::~AbstractWriterFactory ( )
inlinevirtual

Virtual destructor.

Note
It will automatically unregister the factory from the dictionary.

Definition at line 96 of file AbstractWriterFactory.h.

te::xml::AbstractWriterFactory::AbstractWriterFactory ( const std::string &  factoryKey)
protected

It creates the factory.

The key of a AbstractWriterFactory is a string.

Parameters
factoryKeyThe key that identifies the factory.

Member Function Documentation

virtual te::xml::AbstractWriter * te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::build ( )
protectedpure virtualinherited

Concrete factories (derived from this one) must implement this method in order to create objects.

Returns
It returns an object created by the concrete factory.

Implemented in te::xerces::WriterFactory.

static const factory_type* te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::find ( const std::string &  factoryKey)
staticinherited
static dictionary_type& te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::getDictionary ( )
staticinherited

It returns a reference to the internal dictionary of concrete factories.

The dictionary is a singleton.

Returns
A reference to the internal dictionary.
const std::string & te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::getKey ( ) const
inherited

It returns the factory key associated to the concreate factory.

Returns
The factory key associated to the concreate factory.
static te::xml::AbstractWriter* te::xml::AbstractWriterFactory::make ( )
static

It creates a new XML writer using the dafault implementation.

Returns
A new XML writer using the dafault implementation.
static te::xml::AbstractWriter* te::xml::AbstractWriterFactory::make ( const std::string &  writerType)
static

It creates a new XML writer.

Parameters
writerTypeThe type of XML writer to be created.
Returns
A new XML writer.
static void te::xml::AbstractWriterFactory::setDefaultWriter ( const std::string &  writerType)
static

It sets the default driver used to create the XML writer objects.

Parameters
writerTypeThe default driver name for creating XML writer objects.

Member Data Documentation

std::string te::common::AbstractFactory< te::xml::AbstractWriter , std::string , std::less<std::string > >::m_factoryKey
protectedinherited

The key that identifies the concrete factory: it will be used for unregistering the factory during destruction.

Definition at line 136 of file AbstractFactory.h.

std::string te::xml::AbstractWriterFactory::sm_defaultWriterType
staticprivate

The type of the writer to be created if no type is informed.

Definition at line 111 of file AbstractWriterFactory.h.


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