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 terralib/dataaccess/dataset/ObjectId.h
22 
23  \brief This class represents an unique id for a data set element.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_OBJECTID_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_OBJECTID_H
28 
29 // TerraLib
30 #include "../../datatype/AbstractData.h"
31 #include "../Config.h"
32 
33 // Boost
34 #include <boost/ptr_container/ptr_vector.hpp>
35 
36 namespace te
37 {
38  namespace da
39  {
40  /*!
41  \class ObjectId
42 
43  \brief This class represents an unique id for a data set element.
44 
45  \sa AbstractData, ObjectIdSet
46  */
48  {
49  public:
50 
51  /*! \brief Default constructor. */
52  ObjectId();
53 
54  /*! \brief Copy constructor. */
55  ObjectId(const ObjectId& rhs);
56 
57  /*! \brief Destructor. */
58  ~ObjectId();
59 
60  /*!
61  \brief It gets the properties values used to uniquely identify a data set element.
62 
63  \return A vector with the property values.
64 
65  \note The caller will NOT take the ownership of the returned pointers.
66  */
67  const boost::ptr_vector<te::dt::AbstractData>& getValue() const;
68 
69  /*!
70  \brief It gets the properties values used to uniquely identify a data set element as string.
71 
72  \return A string that represents the set of values.
73  */
74  std::string getValueAsString() const;
75 
76  /*!
77  \brief It adds a property value to uniquely identify a data set element.
78 
79  \param data The value of the property.
80 
81  \note This class will take the ownership of the given pointer.
82  */
83  void addValue(te::dt::AbstractData* data);
84 
85  ObjectId* clone() const;
86 
87  bool operator<(const ObjectId& rhs) const;
88 
89  private:
90 
91  boost::ptr_vector<te::dt::AbstractData> m_data; //!< A vector of property values.
92  };
93 
94  } // end namespace da
95 } // end namespace te
96 
97 #endif // __TERRALIB_DATAACCESS_INTERNAL_OBJECTID_H
TEDATAACCESSEXPORT te::da::Expression * operator<(const te::da::Expression &e1, const te::da::Expression &e2)
This class represents an unique id for a data set element.
Definition: ObjectId.h:47
URI C++ Library.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
boost::ptr_vector< te::dt::AbstractData > m_data
A vector of property values.
Definition: ObjectId.h:91
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97