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