STDataLoaderImplFactory.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  \file STDataLoaderImplFactory.h
22 
23  \brief This is the abstract factory for STDataLoaderImpl.
24 */
25 
26 #ifndef __TERRALIB_ST_INTERNAL_STDATALOADERIMPLFACTORY_H
27 #define __TERRALIB_ST_INTERNAL_STDATALOADERIMPLFACTORY_H
28 
29 // TerraLib
30 #include "../../common/AbstractFactory.h"
31 #include "../Config.h"
32 #include "STDataLoaderImpl.h"
33 
34 namespace te
35 {
36  namespace st
37  {
38  //Forward declaration
39  class STDataLoaderImpl;
40 
41  /*!
42  \class STDataLoaderImplFactory
43 
44  \brief This is the abstract factory for STDataLoaderImpl.
45 
46  This is an abstract factory, so you will need to call the static method make
47  as follow:
48 
49  \code
50  STDataLoaderImpl* ds = STDataLoaderImplFactory::make("POSTGIS");
51 
52  \sa STDataLoaderImpl
53  */
54  class TESTEXPORT STDataLoaderImplFactory : public te::common::AbstractFactory<STDataLoaderImpl, std::string>
55  {
56  public:
57 
58  /*!
59  \brief It verifies the type of the DataSource (dsType) and gets the suitable factory.
60  */
61  static STDataLoaderImpl* make(const std::string& dsType);
62 
63  static STDataLoaderImpl* make(const std::string& dsType, const std::string& connInfo);
64 
65  /*!
66  \brief Virtual destructor.
67 
68  \note It will automatically unregister the factory from the dictionary.
69  */
70  virtual ~STDataLoaderImplFactory();
71 
72  /*!
73  \brief It returns the type of STDataLoaderImpl that the factory knows how to create.
74 
75  \return The type of STDataLoaderImpl that the factory knows how to create.
76  */
77  virtual const std::string& getType() const = 0;
78 
79  protected:
80 
81  /*!
82  \brief It creates the factory.
83 
84  The key of a STDataLoaderFactory is a string.
85 
86  \param factoryKey The key that identifies the factory.
87  */
88  STDataLoaderImplFactory(const std::string& factoryKey);
89  };
90 
91  } // end namespace st
92 } // end namespace te
93 
94 #endif // __TERRALIB_ST_INTERNAL_STDATALOADERFACTORYIMPL_H
95 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
This class defines the interface of abstract factories without initializing parameters.
This file contains an abstract class responsible for loading spatiotemporal data from data sources...
URI C++ Library.