QueryIterator.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 QueryIterator.h
22 
23  \brief This class defines a commun interface to represents a graph
24  iterator class. The main diferency to anothers iterators is
25  the possibility to iterate over the edges or vertexs from a
26  graph.
27 
28  The query strategy is used to select a restrict group of
29  elements given a "where clause".
30 */
31 
32 #ifndef __TERRALIB_GRAPH_INTERNAL_QUERYITERATOR_H
33 #define __TERRALIB_GRAPH_INTERNAL_QUERYITERATOR_H
34 
35 // Terralib Includes
36 #include "../Config.h"
37 #include "AbstractIterator.h"
38 
39 // STL Includes
40 #include <vector>
41 
42 namespace te
43 {
44  namespace da { class Expression; }
45 
46  namespace graph
47  {
48  //forward declarations
49  class Edge;
50  class Vertex;
51 
52  /*!
53  \class QueryIterator
54 
55  \brief This class defines a commun interface to represents a graph
56  iterator class. The main diferency to anothers iterators is
57  the possibility to iterate over the edges or vertexs from a
58  graph.
59 
60  The query strategy is used to select a restrict group of
61  elements given a "where clause".
62 
63  \sa AbstractIterator
64  */
65 
67  {
68  public:
69 
70  /*!
71  \brief Default constructor.
72 
73  \param g Pointer to a valid graph implementation
74 
75  */
77 
78  /*!
79  \brief Constructor.
80 
81  \param g Pointer to a valid graph implementation
82 
83  \param e Object used to define the where clause
84 
85  */
87 
88  /*! \brief Virtual destructor. */
89  virtual ~QueryIterator();
90 
91 
92  /** @name Vertex Access Methods
93  * Method used to access vertex elements from a graph.
94  */
95  //@{
96 
97  /*!
98  \brief It returns a pointer to the first vertex element of a graph
99 
100  \return A valid vertex point if the element was found and a null pointer in other case.
101  */
102  virtual te::graph::Vertex* getFirstVertex();
103 
104  /*!
105  \brief It returns a pointer to the first edge element of a graph
106 
107  \return A valid edge point if the element was found and a null pointer in other case.
108  */
109  virtual te::graph::Edge* getFirstEdge();
110 
111  protected:
112 
113  te::da::Expression* m_exp; //|< Attribute to define the where clause used as query by the iterator
114  };
115 
116  } // end namespace graph
117 } // end namespace te
118 
119 #endif // __TERRALIB_GRAPH_INTERNAL_QUERYITERATOR_H
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:178
te::da::Expression * m_exp
This is an abstract class that models a query expression.
Definition: Expression.h:47
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
Definition: Vertex.h:68
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
Definition: Edge.h:58
Abstract class used to define the main functions of graph struct. All graph implementations must used...
Definition: AbstractGraph.h:55
URI C++ Library.
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...
Definition: QueryIterator.h:66
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...