DirectedGraphFactory.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 DirectedGraphFactory.h
22 
23  \brief This is the concrete factory for the directed Graph type.
24 */
25 
26 #ifndef __TERRALIB_GRAPH_INTERNAL_DIRECTEDGRAPHFACTORY_H
27 #define __TERRALIB_GRAPH_INTERNAL_DIRECTEDGRAPHFACTORY_H
28 
29 // TerraLib
30 #include "../core/AbstractGraphFactory.h"
31 #include "../Config.h"
32 
33 namespace te
34 {
35 
36  namespace graph
37  {
38  /*!
39  \class DirectedGraphFactory
40 
41  \brief This is the concrete factory for the directed Graph type.
42 
43  \sa te::graph::AbstractGraphFactory
44  */
46  {
47  public:
48 
49  /*! \brief Destructor. */
51 
52  /*! \brief Returns the type (name) of this factory. */
53  const std::string& getType() const;
54 
55  /*! \brief It returns the list of parameters accepted as graph info. */
56  void getCreationalParameters(std::vector< std::pair<std::string, std::string> >& params) const;
57 
58  /*! \brief It initializes the factory: the singleton instance will be registered in the abstract factory ... */
59  static void initialize();
60 
61  /*! \brief It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the abstract factory ... */
62  static void finalize();
63 
64  protected:
65 
66  /*!
67  \brief Constructor.
68  */
70 
71  /*!
72  \brief This method must be re-implemented by subclasses in order to have a finner control for the graph object instantiation.
73 
74  \param dsInfo The necessary information to access the data source.
75  \param gInfo The necessary information to create the graph.
76 
77  \return A graph.
78 
79  \note The caller will take the ownership of the returned pointer.
80  */
81  te::graph::AbstractGraph* iOpen(const std::string& dsInfo, const std::map<std::string, std::string>& gInfo);
82 
83  /*!
84  \brief This method must be implemented by subclasses (graph types).
85 
86  \param dsInfo The necessary information to access the data source.
87  \param gInfo The necessary information to create the graph.
88 
89  \return The new graph.
90 
91  \note The caller will take the ownership of the returned pointer.
92  */
93  te::graph::AbstractGraph* create(const std::string& dsInfo, const std::map<std::string, std::string>& gInfo);
94 
95  /*!
96  \brief Builder Function used to create the class object.
97  */
98  te::graph::AbstractGraph* build();
99 
100  private:
101 
102  static DirectedGraphFactory* sm_factory; //!< Static instance used to register the factory
103 
104  };
105 
106  } // end namespace graph
107 } // end namespace te
108 
109 #endif // __TERRALIB_GRAPH_INTERNAL_DIRECTEDGRAPHFACTORY_H
110 
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:178
static DirectedGraphFactory * sm_factory
Static instance used to register the factory.
This is the concrete factory for the directed Graph type.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
Definition: AbstractGraph.h:55
URI C++ Library.
This is the abstract factory for Graphs.