ObjectId.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 ObjectId.h
22 
23  \brief An object identifier is meant to represent a unique identifier for an object instance within the context of the web service or database that is serving the object.
24  */
25 
26 #ifndef __TERRALIB_FE_INTERNAL_ABSTRACTID_H
27 #define __TERRALIB_FE_INTERNAL_ABSTRACTID_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <string>
34 
35 namespace te
36 {
37  namespace fe
38  {
39  /*!
40  \class ObjectId
41 
42  \brief An object identifier is meant to represent a unique identifier for an object instance within the context of the web service or database that is serving the object.
43 
44  The Filter Encoding specification does not define
45  a specific element for identifying objects but instead
46  defines the abstract element Id as the head of an XML
47  substitution group that may be used to define an object
48  identifier element for specific object types.
49  <br>
50  Remember that:
51  <ul>
52  <li>GML 3: uses GmlObjectId tag.</li>
53  <li>GML 2: uses FeatureId tag.</li>
54  </ul>
55 
56  \sa Filter
57  */
59  {
60  public:
61 
62  /*!
63  \enum OidType
64 
65  \brief The type of object identification used.
66  */
67  enum OidType
68  {
69  GMLOBJECTID, /*!< Using GML 3 format for oid (default). */
70  FEATUREID /*!< using GML 2 format for oid. */
71  };
72 
73  /** @name Initializer Methods
74  * Methods related to instantiation and destruction.
75  */
76  //@{
77 
78  /*!
79  \brief It initializes a new ObjectId.
80 
81  \param id The object identification value. Must be a non empty value.
82  \param oidType The type of object identification used.
83  */
84  ObjectId(const char* id, OidType oidType);
85 
86  /*! \brief Destructor. */
87  ~ObjectId();
88 
89  //@}
90 
91  /** @name Accessor methods
92  * Methods used to get or set properties.
93  */
94  //@{
95 
96  /*!
97  \brief It sets the feature identification value.
98 
99  \param id The feature identification value.
100  */
101  void setId(const std::string& id);
102 
103  /*!
104  \brief It returns the feature identification value.
105 
106  \return The feature identification value.
107  */
108  const std::string& getId() const;
109 
110  /*!
111  \brief It sets the format type used by the feature identification value.
112 
113  \param t The format type used by the feature identification value.
114  */
115  void setOidType(OidType t);
116 
117  /*!
118  \brief It returns the format type used by the feature identification value.
119 
120  \return The format type used by the feature identification value.
121  */
122  OidType getOidType() const;
123 
124  //@}
125 
126  private:
127 
128  std::string m_id; //!< The id in a string format.
129  OidType m_oidType; //!< May be one of: GmlObjectId, FeatureId, ObjectId, RecordId.
130  };
131 
132  } // end namespace fe
133 } // end namespace te
134 
135 #endif // __TERRALIB_FE_INTERNAL_ABSTRACTID_H
136 
OidType m_oidType
May be one of: GmlObjectId, FeatureId, ObjectId, RecordId.
Definition: ObjectId.h:129
#define TEFEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:59
URI C++ Library.
OidType
The type of object identification used.
Definition: ObjectId.h:67
An object identifier is meant to represent a unique identifier for an object instance within the cont...
Definition: ObjectId.h:58
Configuration flags for the TerraLib Filter Encoding module.
std::string m_id
The id in a string format.
Definition: ObjectId.h:128