All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GraphData.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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 GraphData.h
22 
23  \brief This class define a important struct used to group
24  a map of vertex and edges. A flag is used to indicate
25  if any element of this group was changed.
26 */
27 
28 #ifndef __TERRALIB_GRAPH_INTERNAL_GRAPHDATA_H
29 #define __TERRALIB_GRAPH_INTERNAL_GRAPHDATA_H
30 
31 // Terralib Includes
32 #include "../Config.h"
33 
34 // STL Includes
35 #include <map>
36 
37 namespace te
38 {
39  namespace graph
40  {
41  //forward declarations
42  class Vertex;
43  class Edge;
44 
45  /*!
46  \class GraphData
47 
48  \brief This class define a important struct used to group
49  a map of vertex and edges. A flag is used to indicate
50  if any element of this group was changed.
51 
52  \sa GraphCache
53  */
54 
56  {
57  public:
58 
59  /*! \brief Default constructor. */
60  GraphData(int id);
61 
62  /*! \brief Default destructor. */
63  ~GraphData();
64 
65 
66  typedef std::map<int, Vertex*> VertexMap; //!< typedef for vertex map
67 
68  typedef std::map<int, Edge*> EdgeMap; //!< typedef for edge map
69 
70  /*! \brief Get data identifier. */
71  int getId();
72 
73  /** @name Graph Data Access Methods
74  * Method used to access the graph data, vertex and edge, and properties
75  */
76  //@{
77 
78  /*!
79  \brief It returns the the vertex map
80 
81  \return Map with all vertex from this graph data
82  */
83  VertexMap& getVertexMap();
84 
85  /*!
86  \brief Used to set a map of vertex elements
87 
88  \param map Vertex map
89 
90  */
91  void setVertexMap(const VertexMap& map);
92 
93 
94  /*!
95  \brief It returns the the edge map
96 
97  \return Map with all edges from this graph data
98  */
99  EdgeMap& getEdgeMap();
100 
101  /*!
102  \brief Used to set a map of edge elements
103 
104  \param map Edge map
105 
106  */
107  void setEdgeMap(const EdgeMap& map);
108 
109  //@}
110 
111 
112  /*!
113  \brief Flag used to define the graph data state
114 
115  \param status Boolean value to define the state
116 
117  */
118  void setDirty(bool status);
119 
120  /*!
121  \brief Used to check the graph data state
122 
123  \return Boolean value that defines the graph data state
124 
125  */
126  bool isDirty();
127 
128  private:
129 
130  int m_id; //!< Data identifier
131  bool m_dirty; //!< Flag used to indicate that a element was changed
132 
133  VertexMap m_vertexMap; //!< This map contains all vertexs from this graph.
134  EdgeMap m_edgeMap; //!< This map contains all edges from this graph.
135 
136  };
137  } // end namespace graph
138 } // end namespace te
139 
140 #endif // __TERRALIB_GRAPH_INTERNAL_GRAPHDATA_H
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:216
std::map< int, Vertex * > VertexMap
typedef for vertex map
Definition: GraphData.h:66
VertexMap m_vertexMap
This map contains all vertexs from this graph.
Definition: GraphData.h:133
EdgeMap m_edgeMap
This map contains all edges from this graph.
Definition: GraphData.h:134
bool m_dirty
Flag used to indicate that a element was changed.
Definition: GraphData.h:131
std::map< int, Edge * > EdgeMap
typedef for edge map
Definition: GraphData.h:68
int m_id
Data identifier.
Definition: GraphData.h:130
This class define a important struct used to group a map of vertex and edges. A flag is used to indic...
Definition: GraphData.h:55