GPMConstructorAbstractStrategy.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 GPMConstructorAbstractStrategy.h
22 
23  \brief This class defines a an Abstract class for a GPM constructor.
24 */
25 
26 #ifndef __TERRALIB_SA_INTERNAL_GPMCONSTRUCTORABSTRACTSTRATEGY_H
27 #define __TERRALIB_SA_INTERNAL_GPMCONSTRUCTORABSTRACTSTRATEGY_H
28 
29 // Terralib Includes
30 #include "../Config.h"
31 #include "../Enums.h"
32 
33 // STL Includes
34 #include <memory>
35 #include <string>
36 
37 namespace te
38 {
39  // Forward declarations
40  namespace da
41  {
42  class DataSource;
43  class DataSet;
44  }
45 
46  namespace sa
47  {
48  // Forward declarations
49  class GeneralizedProximityMatrix;
50 
51  /*!
52  \class GPMConstructorAbstractStrategy
53 
54  \brief This class defines a an Abstract class for a GPM constructor.
55 
56  \sa GPMBuilder
57  */
58 
60  {
61  public:
62 
63  /*! \brief Default constructor. */
65 
66  /*! \brief Virtual destructor. */
68 
69 
70  /** @name Methods
71  * Methods used by the GPM constructor
72  */
73  //@{
74 
75  public:
76 
77  GPMConstructorStrategyType getConstructorType();
78 
79  void construct(te::da::DataSource* ds, GeneralizedProximityMatrix* gpm);
80 
81  protected:
82 
83  /*! \brief Function used to create all vertex object based on data set */
84  void createVertexObjects();
85 
86  /*! \brief Added to the edge a new attribute for distance information */
87  void createDistanceAttribute(GeneralizedProximityMatrix* gpm);
88 
89  /*! \brief Function used to generated the edge id */
90  int getEdgeId();
91 
92  /*! \brief Build the edges using specific strategy. */
93  virtual void constructStrategy() = 0;
94 
95  //@}
96 
97  protected:
98 
99  GPMConstructorStrategyType m_type; //!< Constructor Type.
100 
101  int m_edgeId; //!< Attribute used as a index counter for edge objects
102 
103  te::da::DataSource* m_ds; //!< Data Source pointer.
104 
105  GeneralizedProximityMatrix* m_gpm; //!< GPM Pointer.
106  };
107 
108  } // end namespace sa
109 } // end namespace te
110 
111 #endif //__TERRALIB_SA_INTERNAL_GPMCONSTRUCTORABSTRACTSTRATEGY_H
This class defines a Generalized Proximity Matrix.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:119
te::da::DataSource * m_ds
Data Source pointer.
URI C++ Library.
GeneralizedProximityMatrix * m_gpm
GPM Pointer.
GPMConstructorStrategyType m_type
Constructor Type.
This class defines a an Abstract class for a GPM constructor.
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133
int m_edgeId
Attribute used as a index counter for edge objects.
GPMConstructorStrategyType
Strategies to construc a GPM.
Definition: Enums.h:39