te::xerces::ReaderFactory Class Reference

This is the concrete factory for XML reader built on top of Xerces-C++ parser. More...

#include <ReaderFactory.h>

Inheritance diagram for te::xerces::ReaderFactory:
te::xml::ReaderFactory te::common::AbstractFactory< te::xml::Reader, std::string >

Public Types

typedef FactoryDictionary< AbstractFactory< te::xml::Reader, 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...
 
 ~ReaderFactory ()
 Virtual destructor. More...
 

Static Public Member Functions

static void finalize ()
 It finalizes the factory: it will be destroyed and will be unregistered from the abstract factory ReaderFactory. More...
 
static const factory_typefind (const std::string &factoryKey)
 
static dictionary_typegetDictionary ()
 It returns a reference to the internal dictionary of concrete factories. More...
 
static void initialize ()
 It initializes the factory: it will be registered in the abstract factory ReaderFactory. More...
 
static te::xml::Readermake ()
 It creates a new XML reader using the dafault implementation. More...
 
static te::xml::Readermake (const std::string &factoryKey)
 It creates an object with the appropriated factory. More...
 
static te::xml::Readermake (const std::string &readerType)
 It creates a new XML reader. More...
 
static void setDefaultReader (const std::string &readerType)
 It sets the default driver used to create the XML reader objects. More...
 

Protected Member Functions

te::xml::Readerbuild ()
 Concrete factories (derived from this one) must implement this method in order to create objects. More...
 
 ReaderFactory ()
 

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_defaultReaderType
 The type of the reader to be created if no type is informed. More...
 
static ReaderFactorysm_factory
 A pointer to the global Xerces XML Reader factory. More...
 

Friends

class Module
 

Detailed Description

This is the concrete factory for XML reader built on top of Xerces-C++ parser.

See also
te::xml::ReaderFactory

Definition at line 47 of file ReaderFactory.h.

Member Typedef Documentation

◆ dictionary_type

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

Definition at line 73 of file AbstractFactory.h.

◆ factory_type

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

Definition at line 77 of file AbstractFactory.h.

Constructor & Destructor Documentation

◆ ~ReaderFactory()

te::xerces::ReaderFactory::~ReaderFactory ( )
virtual

Virtual destructor.

Note
It will automatically unregister the factory from the dictionary.

Reimplemented from te::xml::ReaderFactory.

◆ ReaderFactory()

te::xerces::ReaderFactory::ReaderFactory ( )
protected

Member Function Documentation

◆ build()

te::xml::Reader* te::xerces::ReaderFactory::build ( )
protectedvirtual

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.

Implements te::common::AbstractFactory< te::xml::Reader, std::string >.

◆ finalize()

static void te::xerces::ReaderFactory::finalize ( )
static

It finalizes the factory: it will be destroyed and will be unregistered from the abstract factory ReaderFactory.

◆ find()

const AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::factory_type * te::common::AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::find ( const std::string &  factoryKey)
inlinestaticinherited

Definition at line 108 of file AbstractFactory.h.

◆ getDictionary()

AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::dictionary_type & te::common::AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::getDictionary
inlinestaticinherited

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

The dictionary is a singleton.

Returns
A reference to the internal dictionary.

Definition at line 106 of file AbstractFactory.h.

◆ getKey()

const std::string & te::common::AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::getKey
inlineinherited

It returns the factory key associated to the concreate factory.

Returns
The factory key associated to the concreate factory.

Definition at line 84 of file AbstractFactory.h.

◆ initialize()

static void te::xerces::ReaderFactory::initialize ( )
static

It initializes the factory: it will be registered in the abstract factory ReaderFactory.

◆ make() [1/3]

static te::xml::Reader* te::xml::ReaderFactory::make ( )
staticinherited

It creates a new XML reader using the dafault implementation.

Returns
A new XML reader using the dafault implementation.

◆ make() [2/3]

te::xml::Reader * te::common::AbstractFactory< te::xml::Reader , std::string , std::less<std::string > >::make ( const std::string &  factoryKey)
inlinestaticinherited

It creates an object with the appropriated factory.

Parameters
factoryKeyA key that identifies the factory used to build the object.
Returns
It returns a new object created by the given factory.
Exceptions
ExceptionIf the concrete factory is not specified or the object can not be built for any reason this methiod may throws an exception.
Note
The caller of this method will take the ownership of the returned object.

Definition at line 97 of file AbstractFactory.h.

◆ make() [3/3]

static te::xml::Reader* te::xml::ReaderFactory::make ( const std::string &  readerType)
staticinherited

It creates a new XML reader.

Parameters
readerTypeThe type of XML reader to be created.
Returns
A new XML reader.

◆ setDefaultReader()

static void te::xml::ReaderFactory::setDefaultReader ( const std::string &  readerType)
staticinherited

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

Parameters
readerTypeThe default driver name for creating XML reader objects.

Friends And Related Function Documentation

◆ Module

friend class Module
friend

Definition at line 69 of file ReaderFactory.h.

Member Data Documentation

◆ m_factoryKey

std::string te::common::AbstractFactory< te::xml::Reader , 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.

◆ sm_defaultReaderType

std::string te::xml::ReaderFactory::sm_defaultReaderType
staticprivateinherited

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

Definition at line 108 of file ReaderFactory.h.

◆ sm_factory

ReaderFactory* te::xerces::ReaderFactory::sm_factory
staticprivate

A pointer to the global Xerces XML Reader factory.

Definition at line 67 of file ReaderFactory.h.


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