te::qt::widgets::LocalGraphicWidgetFactory Class Reference

A concrete factory that builds a graphic widget used to configure a graphic associate with an external graphic element that references a local image. e.g. a SVG file, a PNG file, etc. More...

#include <LocalGraphicWidgetFactory.h>

Inheritance diagram for te::qt::widgets::LocalGraphicWidgetFactory:
te::qt::widgets::AbstractGraphicWidgetFactory te::common::AbstractFactory< AbstractGraphicWidget, std::string >

Public Types

typedef FactoryDictionary< AbstractFactory< AbstractGraphicWidget, 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...
 
Public Destructor

Destructor.

 ~LocalGraphicWidgetFactory ()
 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 AbstractGraphicWidgetmake (const std::string &factoryKey)
 It creates an object with the appropriated factory. More...
 
static void RegisteredWidgets (std::vector< std::string > &keys)
 It informs the key of each registered graphic widget factory. More...
 
Public Initializer

Methods for the control of the factory singleton.

static void initialize ()
 It initializes the factory: the singleton instance will be registered in the abstract factory AbstractGraphicWidgetFactory. More...
 
static void finalize ()
 It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the abstract factory AbstractGraphicWidgetFactory. More...
 

Protected Member Functions

Re-implementation of Pure Virtual Method

Concrete factory methods.

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

Initializers.

 LocalGraphicWidgetFactory ()
 It creates the factory. 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 LocalGraphicWidgetFactorysm_factory
 A pointer to the global factory. More...
 
static std::string sm_factoryKey
 The factory key. More...
 

Detailed Description

A concrete factory that builds a graphic widget used to configure a graphic associate with an external graphic element that references a local image. e.g. a SVG file, a PNG file, etc.

See also
AbstractGraphicWidgetFactory

Definition at line 48 of file LocalGraphicWidgetFactory.h.

Member Typedef Documentation

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

Definition at line 73 of file AbstractFactory.h.

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

Definition at line 77 of file AbstractFactory.h.

Constructor & Destructor Documentation

te::qt::widgets::LocalGraphicWidgetFactory::~LocalGraphicWidgetFactory ( )

Destructor.

Note
It will automatically unregister the factory from the dictionary.
te::qt::widgets::LocalGraphicWidgetFactory::LocalGraphicWidgetFactory ( )
protected

It creates the factory.

The key of a LocalGraphicWidgetFactory is a string.

Parameters
factoryKeyThe key that identifies the factory.

Member Function Documentation

AbstractGraphicWidget* te::qt::widgets::LocalGraphicWidgetFactory::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< AbstractGraphicWidget, std::string >.

static void te::qt::widgets::LocalGraphicWidgetFactory::finalize ( )
static

It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the abstract factory AbstractGraphicWidgetFactory.

static const factory_type* te::common::AbstractFactory< AbstractGraphicWidget , std::string , std::less<std::string > >::find ( const std::string &  factoryKey)
staticinherited
static dictionary_type& te::common::AbstractFactory< AbstractGraphicWidget , 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< AbstractGraphicWidget , 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 void te::qt::widgets::LocalGraphicWidgetFactory::initialize ( )
static

It initializes the factory: the singleton instance will be registered in the abstract factory AbstractGraphicWidgetFactory.

static AbstractGraphicWidget * te::common::AbstractFactory< AbstractGraphicWidget , std::string , std::less<std::string > >::make ( const std::string &  factoryKey)
staticinherited

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.
static void te::qt::widgets::AbstractGraphicWidgetFactory::RegisteredWidgets ( std::vector< std::string > &  keys)
staticinherited

It informs the key of each registered graphic widget factory.

Parameters
keysA pre-created vector of string that will be filled with the keys of each registered graphic widget factory.
Note
All registered factories will be consulted.

Member Data Documentation

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

LocalGraphicWidgetFactory* te::qt::widgets::LocalGraphicWidgetFactory::sm_factory
staticprivate

A pointer to the global factory.

Definition at line 111 of file LocalGraphicWidgetFactory.h.

std::string te::qt::widgets::LocalGraphicWidgetFactory::sm_factoryKey
staticprivate

The factory key.

Definition at line 110 of file LocalGraphicWidgetFactory.h.


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