LiteralEnvelope.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 terralib/dataaccess/query/LiteralEnvelope.h
22 
23  \brief A class that models a literal for Envelope values.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_LITERALENVELOPE_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_LITERALENVELOPE_H
28 
29 // TerraLib
30 #include "Literal.h"
31 
32 // STL
33 #include <memory>
34 
35 namespace te
36 {
37 // Forward declaratons
38  namespace gm { class Envelope; }
39 
40  namespace da
41  {
42  /*!
43  \class LiteralEnvelope
44 
45  \brief A class that models a literal for Envelope values.
46 
47  \sa Expression
48 
49  \note This class doesn't derive from Literal! In future we will do something to adjust this point!
50  */
52  {
53  public:
54 
56 
57  /*!
58  \brief Constructor.
59 
60  \param e The envelope value.
61  \param srid The envelope SRS.
62 
63  \note The LiteralEnvelope will take the ownership of the given envelope.
64  */
65  LiteralEnvelope(te::gm::Envelope* e, int srid);
66 
67  /*!
68  \brief Constructor.
69 
70  \param e The envelope value.
71  \param srid The envelope SRS.
72  */
73  LiteralEnvelope(const te::gm::Envelope& e, int srid);
74 
75  /*! \brief Copy constructor. */
76  LiteralEnvelope(const LiteralEnvelope& rhs);
77 
78  /*! \brief Destructor. */
79  ~LiteralEnvelope();
80 
81  /*! Assignment operator. */
82  LiteralEnvelope& operator=(const LiteralEnvelope& rhs);
83 
84  /*! \brief It creates a new copy of this expression. */
85  Expression* clone() const;
86 
87  /*!
88  \brief It returns the associated envelope value.
89 
90  \return The associated envelope value.
91  */
92  te::gm::Envelope* getValue() const;
93 
94  /*!
95  \brief It sets the envelope value associated to the Literal.
96 
97  \param e The envelope value.
98 
99  \note The LiteralEnvelope will take the ownership of the given envelope.
100  */
101  void setValue(te::gm::Envelope* e);
102 
103  /*!
104  \brief It returns the envelope SRS id.
105 
106  \return The envelope SRS id.
107  */
108  int getSRID() const { return m_srid; }
109 
110  /*!
111  \brief It sets the envelope SRS id.
112 
113  \param srid The envelope SRS id.
114  */
115  void setSRID(int srid) { m_srid = srid; }
116 
117  private:
118 
119  std::auto_ptr<te::gm::Envelope> m_eval; //!< The envelope value.
120  int m_srid; //!< The envelope SRS ID.
121  };
122 
123  } // end namespace da
124 } // end namespace te
125 
126 #endif // __TERRALIB_DATAACCESS_INTERNAL_LITERALENVELOPE_H
127 
void setSRID(int srid)
It sets the envelope SRS id.
std::auto_ptr< te::gm::Envelope > m_eval
The envelope value.
This is an abstract class that models a query expression.
Definition: Expression.h:47
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
int m_srid
The envelope SRS ID.
URI C++ Library.
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
int getSRID() const
It returns the envelope SRS id.
A class that models a literal for Envelope values.
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
This class models a literal value.