TeVisualFactory Class Reference

#include <TeVisual.h>

Inheritance diagram for TeVisualFactory:

TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >

Detailed Description

Definition at line 356 of file TeVisual.h.


Public Types

typedef std::map
< PRODUCTIDTYPE,
TeAbstractFactory
< PRODUCT, PARAMS,
PRODUCTIDTYPE > * > 
TeFactoryMap
 To link each product to its factory.

Public Member Functions

virtual TeVisualbuild ()
 Builds a new product without parameters (should be implemented by descendants).
 TeVisualFactory (const string &facName)

Static Public Member Functions

static TeFactoryMapinstance ()
 Returns the single instance of the factory registration.
static PRODUCT * make (PRODUCTIDTYPE prodId)
 Virtual constructor: explictly identifies which product should be made.
static PRODUCT * make (PARAMS *arg)
 Virtual constructor: make the product from some arguments.

Protected Member Functions

virtual PRODUCT * build (PARAMS *)
 Builds a new product from a set of parameters (should be implemented by descendants).

Member Typedef Documentation

template<typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE = std::string>
typedef std::map<PRODUCTIDTYPE, TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>* > TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >::TeFactoryMap [inherited]

Definition at line 52 of file TeAbstractFactory.h.


Constructor & Destructor Documentation

TeVisualFactory::TeVisualFactory ( const string facName  )  [inline]

Definition at line 359 of file TeVisual.h.


Member Function Documentation

template<typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE = std::string>
virtual PRODUCT* TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >::build ( PARAMS *   )  [inline, protected, virtual, inherited]

Reimplemented in TeExternalThemeFactory, TeFileThemeFactory, TeSFSThemeFactory, TeThemeFactory, and TeViewTreeFactory.

Definition at line 64 of file TeAbstractFactory.h.

00065         { 
00066                 return PRODUCT::DefaultObject(); 
00067         }

virtual TeVisual* TeVisualFactory::build (  )  [inline, virtual]

Reimplemented from TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >.

Definition at line 361 of file TeVisual.h.

00362         {       return new TeVisual(); }

template<typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE = std::string>
static TeFactoryMap& TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >::instance (  )  [inline, static, inherited]

Definition at line 55 of file TeAbstractFactory.h.

Referenced by TeGDriverFactory::FindFactory(), TeGDriverFactory::GetGeoFilesInfo(), TeAbstractFactory< TeGeoDataDriver, TeGDriverParams, oratext * >::make(), and TeAbstractFactory< TeGeoDataDriver, TeGDriverParams, oratext * >::TeAbstractFactory().

00056         { 
00057                 static TeFactoryMap Fmap_;
00058                 return Fmap_;
00059         }

template<typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE = std::string>
static PRODUCT* TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >::make ( PRODUCTIDTYPE  prodId  )  [inline, static, inherited]

Definition at line 116 of file TeAbstractFactory.h.

00117         {
00118                 // try to find the name on the factory dictionary
00119                 typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(prodId);
00120 
00121                 // Not found ?  return the Default Object
00122                 if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
00123                         return PRODUCT::DefaultObject();
00124 
00125                 // Create an object, based on the input parameters
00126                 return (*i).second->build();
00127         }

template<typename PRODUCT, typename PARAMS, typename PRODUCTIDTYPE = std::string>
static PRODUCT* TeAbstractFactory< PRODUCT, PARAMS, PRODUCTIDTYPE >::make ( PARAMS *  arg  )  [inline, static, inherited]

Examples:
createTheme.cpp, and rasterSlicing.cpp.

Definition at line 96 of file TeAbstractFactory.h.

Referenced by TeDatabase::loadLegend(), TeDatabase::loadTheme(), TeDatabase::loadThemes(), TeDatabase::loadView(), TeDatabase::loadViewSet(), loadViewSetAndThemeGroups(), main(), TeFileTheme::setFileName(), TeExportToOGR(), TeImportOGR(), and TeLegendEntry::visual().

00097         {
00098                 // If there are no arguments or factory identification return the default object
00099                 if (!arg)
00100                         return PRODUCT::DefaultObject();
00101 
00102                 PRODUCTIDTYPE productId = arg->getProductId();
00103 
00104                 // try to find the name on the factory dictionary
00105                 typename TeFactoryMap::iterator i = TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().find(productId);
00106 
00107                 // Not found ?  return the Default Object
00108                 if (i == TeAbstractFactory<PRODUCT,PARAMS,PRODUCTIDTYPE>::instance().end())
00109                         return PRODUCT::DefaultObject();
00110 
00111                 // Create an object, based on the input parameters
00112                         return (*i).second->build(arg);
00113         }


The documentation for this class was generated from the following file:
Generated on Sun Jul 29 04:11:37 2012 for TerraLib - Development Source by  doxygen 1.5.3