AbstractGraphLoaderStrategyFactory.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 AbstractGraphLoaderStrategyFactory.h
22 
23  \brief This is the abstract factory for graph loader strategy.
24 */
25 
26 #ifndef __TERRALIB_GRAPH_INTERNAL_ABSTRACTGRAPHLOADERSTRATEGYFACTORY_H
27 #define __TERRALIB_GRAPH_INTERNAL_ABSTRACTGRAPHLOADERSTRATEGYFACTORY_H
28 
29 // TerraLib
30 #include "../../common/AbstractFactory.h"
31 #include "../Config.h"
32 
33 namespace te
34 {
35  namespace graph
36  {
37  //forward declarations
38  class AbstractGraphLoaderStrategy;
39  class GraphMetadata;
40 
41  /*!
42  \class AbstractGraphLoaderStrategyFactory
43 
44  \brief This is the abstract factory for graph loader strategy.
45 
46  \sa AbstractGraphLoaderStrategy
47  */
48  class TEGRAPHEXPORT AbstractGraphLoaderStrategyFactory : public te::common::AbstractFactory<AbstractGraphLoaderStrategy, std::string>
49  {
50  public:
51 
52  /*!
53  \brief It creates and returns default graph loader strategy.
54 
55  \return A default graph loader strategy.
56 
57  \note The caller will take the ownership of the returned pointer.
58  */
59  static AbstractGraphLoaderStrategy* make();
60 
61  /*!
62  \brief It creates graph loader strategy with the proper type.
63 
64  \param lsType Type The name of the specific graph loader strategy type to be used to create.
65 
66  \return A proper graph loader strategy.
67 
68  \note The caller will take the ownership of the returned pointer.
69  */
70  static AbstractGraphLoaderStrategy* make(const std::string& lsType);
71 
72  /*!
73  \brief It creates graph loader strategy with the proper type.
74 
75  \param lsType Type The name of the specific graph loader strategy type to be used to create.
76  \param gm Pointer to a class that defines the graph metadata
77 
78  \return A proper graph loader strategy.
79 
80  \note The caller will take the ownership of the returned pointer.
81 
82  */
83  static AbstractGraphLoaderStrategy* make(const std::string& lsType, GraphMetadata* gm);
84 
85 
86  /*! \brief Destructor. */
88 
89  /*! \brief Returns the type (name) of this factory. */
90  virtual const std::string& getType() const = 0;
91 
92  protected:
93 
94  /*!
95  \brief Constructor.
96 
97  \param factoryKey The key that identifies the factory.
98  */
99  AbstractGraphLoaderStrategyFactory(const std::string& factoryKey);
100 
101  /*!
102  \brief This method must be implemented by subclasses (loader strategy types).
103 
104  \param gm
105 
106  \return A proper graph loader strategy.
107 
108  \note The caller will take the ownership of the returned pointer.
109  */
110  virtual AbstractGraphLoaderStrategy* create(GraphMetadata* gm) = 0;
111  };
112 
113  } // end namespace graph
114 } // end namespace te
115 
116 #endif // __TERRALIB_GRAPH_INTERNAL_ABSTRACTGRAPHLOADERSTRATEGYFACTORY_H
This class defines the interface of abstract factories without initializing parameters.
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:178
This is the abstract factory for graph loader strategy.
URI C++ Library.
This class define the main functions necessary to save and load the graph data and metadata informati...
Class used to define the graph metadata informations.
Definition: GraphMetadata.h:56