SortProperty.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 SortProperty.h
22 
23  \brief A sort property name and order type.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_SORTPROPERTY_H
27 #define __TERRALIB_FE_INTERNAL_SORTPROPERTY_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 namespace te
33 {
34  namespace fe
35  {
36 // Forward declarations
37  class PropertyName;
38 
39  /*!
40  \class SortProperty
41 
42  \brief A sort property name and order type.
43 
44  The order default will be ascendent if none is informed.
45 
46  \sa SortBy, PropertyName
47  */
49  {
50  public:
51 
52  /*!
53  \enum SortOrder
54 
55  \brief Sort order type: asc or desc.
56  */
57  enum SortOrder
58  {
59  DESC, /*!< Descendent order type. */
60  ASC /*!< Ascendent order type. */
61  };
62 
63  /** @name Initializer Methods
64  * Methods related to instantiation and destruction.
65  */
66  //@{
67 
68  /*! \brief It initializes a new SortProperty. */
69  SortProperty();
70 
71  /*! \brief Destructor. */
72  ~SortProperty();
73 
74  //@}
75 
76  /** @name Accessor methods
77  * Methods used to get or set properties.
78  */
79  //@{
80 
81  /*!
82  \brief It sets the property name.
83 
84  \param p The property name. The SortProperty will take the ownership of the property name.
85 
86  \note The previous property is discarted.
87  */
88  void setPropertyName(PropertyName* p);
89 
90  /*!
91  \brief It returns the property name.
92 
93  \return The property name.
94  */
95  const PropertyName* getPropertyName() const;
96 
97  /*!
98  \brief It sets the sort order.
99 
100  \param direction Sort order direction (ASC or DESC).
101  */
102  void setSortOrder(SortOrder direction);
103 
104  /*!
105  \brief It return the associated sort order.
106 
107  \return The associated sort order.
108  */
109  SortOrder getSortOrder() const;
110 
111  //@}
112 
113  private:
114 
115  PropertyName* m_property; //!< Mandatory.
116  SortOrder m_sortOrder; //!< Optional.
117  };
118 
119  } // end namespace fe
120 } // end namespace te
121 
122 #endif // __TERRALIB_FE_INTERNAL_SORTPROPERTY_H
SortOrder m_sortOrder
Optional.
Definition: SortProperty.h:116
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
PropertyName * m_property
Mandatory.
Definition: SortProperty.h:115
A sort property name and order type.
Definition: SortProperty.h:48
This class is used to encode the name of any property of an object.
Definition: PropertyName.h:54
URI C++ Library.
SortOrder
Sort order type: asc or desc.
Definition: SortProperty.h:57
SortOrder
Sort order type: asc or desc.
Definition: Enums.h:38
Configuration flags for the TerraLib Filter Encoding module.