All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataSet.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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/memory/DataSet.cpp
22 
23  \brief Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver.
24 */
25 
26 // TerraLib
27 #include "../common/STLUtils.h"
28 #include "../common/Translator.h"
29 #include "../dataaccess/dataset/DataSetType.h"
30 #include "../dataaccess/utils/Utils.h"
31 #include "../datatype/ByteArray.h"
32 #include "../datatype/DataType.h"
33 #include "../datatype/Property.h"
34 #include "../datatype/SimpleData.h"
35 #include "../datatype/Utils.h"
36 #include "../geometry/Envelope.h"
37 #include "../geometry/Geometry.h"
38 #include "../geometry/Utils.h"
39 #include "DataSet.h"
40 #include "DataSetItem.h"
41 #include "Exception.h"
42 
43 // STL
44 #include <limits>
45 
47  : m_items(new boost::ptr_vector<DataSetItem>),
48  m_i(-1)
49 {
51 }
52 
54  : m_items(new boost::ptr_vector<DataSetItem>),
55  m_i(-1)
56 {
58 
59  copy(rhs, 0);
60 }
61 
62 te::mem::DataSet::DataSet(const DataSet& rhs, const bool deepCopy)
63  : m_items(new boost::ptr_vector<DataSetItem>),
64  m_i(-1)
65 {
67 
68  if(deepCopy)
69  m_items.reset(new boost::ptr_vector<DataSetItem>(*(rhs.m_items)));
70  else
71  m_items = rhs.m_items;
72 }
73 
74 te::mem::DataSet::DataSet(te::da::DataSet& rhs, const std::vector<std::size_t>& properties, std::size_t limit)
75  : m_items(new boost::ptr_vector<DataSetItem>),
76  m_i(-1)
77 {
78  for(std::size_t i = 0; i != properties.size(); ++i)
79  {
80  m_pnames.push_back(rhs.getPropertyName(properties[i]));
81  m_ptypes.push_back(rhs.getPropertyDataType(properties[i]));
82  }
83 
84  copy(rhs, properties, limit);
85 }
86 
88 {
89 }
90 
92 {
93  m_items->clear();
94 }
95 
96 void te::mem::DataSet::copy(te::da::DataSet& src, std::size_t limit)
97 {
98  std::vector<std::size_t> properties;
99 
100  const std::size_t np = src.getNumProperties();
101 
102  for(std::size_t i = 0; i != np; ++i)
103  properties.push_back(i);
104 
105  copy(src, properties, limit);
106 }
107 
108 void te::mem::DataSet::copy(te::da::DataSet& src, const std::vector<std::size_t>& properties, std::size_t limit)
109 {
110  bool unlimited = true;
111 
112  if(limit == 0)
113  {
114  limit = std::numeric_limits<std::size_t>::max();
115  }
116  else
117  {
118  m_items->reserve(m_items->size() + limit);
119  unlimited = false;
120  }
121 
122  std::size_t i = 0;
123 
124  const std::size_t nproperties = properties.size();
125 
126  while(src.moveNext() && (i < limit))
127  {
128  std::auto_ptr<DataSetItem> item(new DataSetItem(this));
129 
130  for(std::size_t c = 0; c < nproperties; ++c)
131  {
132  if(!src.isNull(properties[c]))
133  item->setValue(c, src.getValue(properties[c]).release());
134  else
135  item->setValue(c, 0);
136  }
137 
138  m_items->push_back(item.release());
139 
140  ++i;
141  }
142 
143  //src.moveBeforeFirst();
144 
145  if(!unlimited & (i < limit))
146  throw Exception(TR_MEMORY("The source dataset has few items than requested copy limit!"));
147 }
148 
150 {
151  m_items->push_back(item);
152 }
153 
155 {
156  m_items->erase(m_items->begin() + m_i);
157 }
158 
160 {
161  const std::size_t nitems = m_items->size();
162 
163  for(std::size_t i = 0; i < nitems; ++i)
164  {
165  if(&(m_items->operator[](i)) == item)
166  {
167  m_items->erase(m_items->begin() + i);
168  break;
169  }
170  }
171 
172  throw Exception(TR_DATAACCESS("Item not found in the dataset!"));
173 }
174 
175 void te::mem::DataSet::add(const std::string& propertyName, std::size_t propertyType, const te::dt::AbstractData* defaultValue)
176 {
177  m_pnames.push_back(propertyName);
178  m_ptypes.push_back(propertyType);
179 
180  const std::size_t nitems = m_items->size();
181 
182  for(std::size_t i = 0; i < nitems; ++i)
183  m_items->operator[](i).m_data.push_back(defaultValue ? defaultValue->clone() : 0);
184 }
185 
186 void te::mem::DataSet::drop(std::size_t pos)
187 {
188  const std::size_t nitems = m_items->size();
189 
190  for(std::size_t i = 0; i < nitems; ++i)
191  m_items->operator[](i).m_data.erase( m_items->operator[](i).m_data.begin() + pos);
192 
193  m_pnames.erase(m_pnames.begin() + pos);
194  m_ptypes.erase(m_ptypes.begin() + pos);
195 }
196 
198 {
199  //std::size_t propPos = m_dt->getPropertyPosition(prop);
200 
201  //const std::size_t nitems = m_items->size();
202 
203  //for(std::size_t i = 0; i < nitems; ++i)
204  // m_items->operator[](i).m_data.replace(m_items->operator[](i).m_data.begin() + propPos, 0);
205  throw Exception("No implemented yet!");
206 }
207 
209 {
210  return te::common::RANDOM;
211 }
212 
214 {
215  return te::common::RWAccess;
216 }
217 
218 std::auto_ptr<te::gm::Envelope> te::mem::DataSet::getExtent(std::size_t i)
219 {
220  std::auto_ptr<te::gm::Envelope> mbr(new te::gm::Envelope);
221 
222  const std::size_t nitems = m_items->size();
223 
224  for(std::size_t ii = 0; ii < nitems; ++ii)
225  {
226  std::auto_ptr<te::gm::Geometry> geom((*m_items)[ii].getGeometry(i));
227 
228  mbr->Union(*(geom->getMBR()));
229  }
230 
231  return mbr;
232 }
233 
235 {
236  return m_pnames.size();
237 }
238 
239 int te::mem::DataSet::getPropertyDataType(std::size_t pos) const
240 {
241  return m_ptypes[pos];
242 }
243 
244 void te::mem::DataSet::setPropertyDataType(int dt, std::size_t pos)
245 {
246  m_ptypes[pos] = dt;
247 }
248 
249 std::string te::mem::DataSet::getPropertyName(std::size_t pos) const
250 {
251  return m_pnames[pos];
252 }
253 
254 void te::mem::DataSet::setPropertyName(const std::string& name, std::size_t pos)
255 {
256  m_pnames[pos] = name;
257 }
258 
259 std::string te::mem::DataSet::getDatasetNameOfProperty(std::size_t /*pos*/) const
260 {
261  throw Exception("No implemented yet!");
262 }
263 
265 {
266  return (*m_items)[m_i].clone().get();
267 }
268 
270 {
271  return m_items->empty();
272 }
273 
275 {
276  return false;
277 }
278 
279 std::size_t te::mem::DataSet::size() const
280 {
281  return m_items->size();
282 }
283 
285 {
286  ++m_i;
287  return m_i < static_cast<int>(m_items->size());
288 }
289 
291 {
292  --m_i;
293  return m_i > 0;
294 }
295 
297 {
298  m_i = -1;
299  return true;
300 }
301 
303 {
304  m_i = 0;
305  return true;
306 }
307 
309 {
310  m_i = m_items->size() - 1;
311  return m_i < static_cast<int>(m_items->size());
312 }
313 
314 bool te::mem::DataSet::move(std::size_t i)
315 {
316  m_i = i;
317  return m_i < static_cast<int>(m_items->size());
318 }
319 
321 {
322  return m_i == 0;
323 }
324 
326 {
327  return m_i < 0;
328 }
329 
331 {
332  return m_i == (static_cast<int>(m_items->size()) - 1);
333 }
334 
336 {
337  return m_i > static_cast<int>(m_items->size());
338 }
339 
340 char te::mem::DataSet::getChar(std::size_t i) const
341 {
342  return (*m_items)[m_i].getChar(i);
343 }
344 
345 void te::mem::DataSet::setChar(std::size_t i, char value)
346 {
347  (*m_items)[m_i].setChar(i, value);
348 }
349 
350 void te::mem::DataSet::setChar(const std::string& name, char value)
351 {
352  (*m_items)[m_i].setChar(name, value);
353 }
354 
355 unsigned char te::mem::DataSet::getUChar(std::size_t i) const
356 {
357  return (*m_items)[m_i].getUChar(i);
358 }
359 
360 void te::mem::DataSet::setUChar(std::size_t i, unsigned char value)
361 {
362  (*m_items)[m_i].setUChar(i, value);
363 }
364 
365 void te::mem::DataSet::setUChar(const std::string& name, unsigned char value)
366 {
367  (*m_items)[m_i].setUChar(name, value);
368 }
369 
370 boost::int16_t te::mem::DataSet::getInt16(std::size_t i) const
371 {
372  return (*m_items)[m_i].getInt16(i);
373 }
374 
375 void te::mem::DataSet::setInt16(std::size_t i, boost::int16_t value)
376 {
377  (*m_items)[m_i].setInt16(i, value);
378 }
379 
380 void te::mem::DataSet::setInt16(const std::string& name, boost::int16_t value)
381 {
382  (*m_items)[m_i].setInt16(name, value);
383 }
384 
385 boost::int32_t te::mem::DataSet::getInt32(std::size_t i) const
386 {
387  return (*m_items)[m_i].getInt32(i);
388 }
389 
390 void te::mem::DataSet::setInt32(std::size_t i, boost::int32_t value)
391 {
392  (*m_items)[m_i].setInt32(i, value);
393 }
394 
395 void te::mem::DataSet::setInt32(const std::string& name, boost::int32_t value)
396 {
397  (*m_items)[m_i].setInt32(name, value);
398 }
399 
400 boost::int64_t te::mem::DataSet::getInt64(std::size_t i) const
401 {
402  return (*m_items)[m_i].getInt64(i);
403 }
404 
405 void te::mem::DataSet::setInt64(std::size_t i, boost::int64_t value)
406 {
407  (*m_items)[m_i].setInt64(i, value);
408 }
409 
410 void te::mem::DataSet::setInt64(const std::string& name, boost::int64_t value)
411 {
412  (*m_items)[m_i].setInt64(name, value);
413 }
414 
415 bool te::mem::DataSet::getBool(std::size_t i) const
416 {
417  return (*m_items)[m_i].getBool(i);
418 }
419 
420 void te::mem::DataSet::setBool(std::size_t i, bool value)
421 {
422  (*m_items)[m_i].setBool(i, value);
423 }
424 
425 void te::mem::DataSet::setBool(const std::string& name, bool value)
426 {
427  (*m_items)[m_i].setBool(name, value);
428 }
429 
430 float te::mem::DataSet::getFloat(std::size_t i) const
431 {
432  return (*m_items)[m_i].getFloat(i);
433 }
434 
435 void te::mem::DataSet::setFloat(std::size_t i, float value)
436 {
437  (*m_items)[m_i].setFloat(i, value);
438 }
439 
440 void te::mem::DataSet::setFloat(const std::string& name, float value)
441 {
442  (*m_items)[m_i].setFloat(name, value);
443 }
444 
445 double te::mem::DataSet::getDouble(std::size_t i) const
446 {
447  return (*m_items)[m_i].getDouble(i);
448 }
449 
450 void te::mem::DataSet::setDouble(std::size_t i, double value)
451 {
452  (*m_items)[m_i].setDouble(i, value);
453 }
454 
455 void te::mem::DataSet::setDouble(const std::string& name, double value)
456 {
457  (*m_items)[m_i].setDouble(name, value);
458 }
459 
460 std::string te::mem::DataSet::getNumeric(std::size_t i) const
461 {
462  return (*m_items)[m_i].getNumeric(i);
463 }
464 
465 void te::mem::DataSet::setNumeric(std::size_t i, const std::string& value)
466 {
467  (*m_items)[m_i].setNumeric(i, value);
468 }
469 
470 void te::mem::DataSet::setNumeric(const std::string& name, const std::string& value)
471 {
472  (*m_items)[m_i].setNumeric(name, value);
473 }
474 
475 std::string te::mem::DataSet::getString(std::size_t i) const
476 {
477  return (*m_items)[m_i].getString(i);
478 }
479 
480 void te::mem::DataSet::setString(std::size_t i, const std::string& value)
481 {
482  (*m_items)[m_i].setString(i, value);
483 }
484 
485 void te::mem::DataSet::setString(const std::string& name, const std::string& value)
486 {
487  (*m_items)[m_i].setString(name, value);
488 }
489 
490 std::auto_ptr<te::dt::ByteArray> te::mem::DataSet::getByteArray(std::size_t i) const
491 {
492  return (*m_items)[m_i].getByteArray(i);
493 }
494 
496 {
497  (*m_items)[m_i].setByteArray(i, value);
498 }
499 
500 void te::mem::DataSet::setByteArray(const std::string& name, te::dt::ByteArray* value)
501 {
502  (*m_items)[m_i].setByteArray(name, value);
503 }
504 
505 std::auto_ptr<te::gm::Geometry> te::mem::DataSet::getGeometry(std::size_t i) const
506 {
507  return (*m_items)[m_i].getGeometry(i);
508 }
509 
511 {
512  (*m_items)[m_i].setGeometry(i, value);
513 }
514 
515 void te::mem::DataSet::setGeometry(const std::string& name, te::gm::Geometry* value)
516 {
517  (*m_items)[m_i].setGeometry(name, value);
518 }
519 
520 std::auto_ptr<te::rst::Raster> te::mem::DataSet::getRaster(std::size_t i) const
521 {
522  return (*m_items)[m_i].getRaster(i);
523 }
524 
525 void te::mem::DataSet::setRaster(std::size_t i, te::rst::Raster* value)
526 {
527  (*m_items)[m_i].setRaster(i, value);
528 }
529 
530 void te::mem::DataSet::setRaster(const std::string& name, te::rst::Raster* value)
531 {
532  (*m_items)[m_i].setRaster(name, value);
533 }
534 
535 std::auto_ptr<te::dt::DateTime> te::mem::DataSet::getDateTime(std::size_t i) const
536 {
537  return std::auto_ptr<te::dt::DateTime>((*m_items)[m_i].getDateTime(i));
538 }
539 
541 {
542  (*m_items)[m_i].setDateTime(i, value);
543 }
544 
545 void te::mem::DataSet::setDateTime(const std::string& name, te::dt::DateTime* value)
546 {
547  (*m_items)[m_i].setDateTime(name, value);
548 }
549 
550 std::auto_ptr<te::dt::Array> te::mem::DataSet::getArray(std::size_t i) const
551 {
552  return std::auto_ptr<te::dt::Array>(0);
553 }
554 
555 std::auto_ptr<te::dt::AbstractData> te::mem::DataSet::getValue(std::size_t i) const
556 {
557  return (*m_items)[m_i].getValue(i);
558 }
559 
561 {
562  (*m_items)[m_i].setValue(i, value);
563 }
564 
565 void te::mem::DataSet::setValue(const std::string& name, te::dt::AbstractData* ad)
566 {
567  (*m_items)[m_i].setValue(name, ad);
568 }
569 
570 bool te::mem::DataSet::isNull(std::size_t i) const
571 {
572  return (*m_items)[m_i].isNull(i);
573 }
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
Method for retrieving a date and time attribute value.
Definition: DataSet.cpp:535
virtual AbstractData * clone() const =0
It returns a clone of this object.
bool isNull(std::size_t i) const
It checks if the attribute value is NULL.
Definition: DataSet.cpp:570
int getPropertyDataType(std::size_t pos) const
It returns the underlying data type of the property at position pos.
Definition: DataSet.cpp:239
~DataSet()
Destructor.
Definition: DataSet.cpp:87
std::size_t size() const
It returns the collection size, if it is known.
Definition: DataSet.cpp:279
void drop(std::size_t pos)
It drops a property from the dataset.
Definition: DataSet.cpp:186
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
Definition: DataSet.h:64
#define TR_MEMORY(message)
Definition: Config.h:82
std::vector< int > m_ptypes
The list of property types.
Definition: DataSet.h:382
void setUChar(std::size_t i, unsigned char value)
Definition: DataSet.cpp:360
std::string getDatasetNameOfProperty(std::size_t pos) const
It returns the underlying dataset name of the property at position pos.
Definition: DataSet.cpp:259
void update(te::dt::Property *prop)
It update a property from the dataset.
Definition: DataSet.cpp:197
void add(DataSetItem *item)
It adds a new item to the dataset and takes its ownership.
Definition: DataSet.cpp:149
std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
Method for retrieving a geometric attribute value.
Definition: DataSet.cpp:505
DataSet()
Default constructor.
Definition: DataSet.h:116
std::string getString(std::size_t i) const
Method for retrieving a string value attribute.
Definition: DataSet.cpp:475
std::auto_ptr< DataSetItem > clone() const
It returns a clone of the DataSetItem.
Definition: DataSetItem.cpp:89
boost::int32_t getInt32(std::size_t i) const
Method for retrieving a 32-bit integer attribute value (4 bytes long).
Definition: DataSet.cpp:385
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
te::common::AccessPolicy getAccessPolicy() const
It returns the read and write permission associated to the dataset.
Definition: DataSet.cpp:213
An exception class for the TerraLib In-Memory Data Access driver.
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
Definition: DataSetItem.h:56
bool isAtEnd() const
It tells if the dataset internal pointer is on the last element of the collection.
Definition: DataSet.cpp:330
std::string getNumeric(std::size_t i) const
Method for retrieving a numeric attribute value.
Definition: DataSet.cpp:460
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
void setRaster(std::size_t i, te::rst::Raster *value)
Definition: DataSet.cpp:525
bool isConnected() const
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connect...
Definition: DataSet.cpp:274
void setInt32(std::size_t i, boost::int32_t value)
Definition: DataSet.cpp:390
bool moveFirst()
It moves the internal pointer to the first item in the collection.
Definition: DataSet.cpp:302
TEDATAACCESSEXPORT void GetPropertyInfo(const DataSetType *const dt, std::vector< std::string > &pnames, std::vector< int > &ptypes)
Definition: Utils.cpp:545
boost::int16_t getInt16(std::size_t i) const
Method for retrieving a 16-bit integer attribute value (2 bytes long).
Definition: DataSet.cpp:370
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
double getDouble(std::size_t i) const
Method for retrieving a double attribute value.
Definition: DataSet.cpp:445
void copy(te::da::DataSet &src, std::size_t limit=0)
It copies up to limit items from the source dataset.
Definition: DataSet.cpp:96
void setInt16(std::size_t i, boost::int16_t value)
Definition: DataSet.cpp:375
void setGeometry(std::size_t i, te::gm::Geometry *value)
Definition: DataSet.cpp:510
bool moveLast()
It sets the dataset internal pointer to the last item in the collection.
Definition: DataSet.cpp:308
std::auto_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
Method for retrieving a byte array.
Definition: DataSet.cpp:490
std::vector< std::string > m_pnames
The list of property names.
Definition: DataSet.h:381
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
bool isAfterEnd() const
It tells if the dataset internal pointer is on the sentinel position after the last element of the co...
Definition: DataSet.cpp:335
void setInt64(std::size_t i, boost::int64_t value)
Definition: DataSet.cpp:405
std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
Definition: DataSet.cpp:555
void setDateTime(std::size_t i, te::dt::DateTime *value)
Definition: DataSet.cpp:540
bool movePrevious()
It moves the internal pointer to the previous item of the collection.
Definition: DataSet.cpp:290
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
virtual std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
Definition: DataSet.cpp:151
void setValue(std::size_t i, te::dt::AbstractData *value)
Definition: DataSet.cpp:560
boost::int64_t getInt64(std::size_t i) const
Method for retrieving a 64-bit integer attribute value (8 bytes long).
Definition: DataSet.cpp:400
bool isBeforeBegin() const
It tells if the dataset internal pointer is in a position before the first element of the collection ...
Definition: DataSet.cpp:325
std::size_t getNumProperties() const
It returns the number of properties that composes an item of the dataset.
Definition: DataSet.cpp:234
boost::shared_ptr< boost::ptr_vector< DataSetItem > > m_items
The list of dataset items.
Definition: DataSet.h:380
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
void clear()
It clears all the dataset items.
Definition: DataSet.cpp:91
#define TR_DATAACCESS(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
Definition: Config.h:95
DataSetItem * getItem() const
Definition: DataSet.cpp:264
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
A class that models the description of a dataset.
Definition: DataSetType.h:72
te::common::TraverseType getTraverseType() const
It returns the traverse type associated to the dataset.
Definition: DataSet.cpp:208
bool moveNext()
It moves the internal pointer to the next item of the collection.
Definition: DataSet.cpp:284
It models a property definition.
Definition: Property.h:59
float getFloat(std::size_t i) const
Method for retrieving a float attribute value.
Definition: DataSet.cpp:430
bool moveBeforeFirst()
It moves the internal pointer to a position before the first item in the collection.
Definition: DataSet.cpp:296
An abstract class for raster data strucutures.
Definition: Raster.h:70
std::auto_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
Definition: DataSet.cpp:218
bool isEmpty() const
It returns true if the collection is empty.
Definition: DataSet.cpp:269
void setBool(std::size_t i, bool value)
Definition: DataSet.cpp:420
void setNumeric(std::size_t i, const std::string &value)
Definition: DataSet.cpp:465
bool getBool(std::size_t i) const
Method for retrieving a boolean attribute value.
Definition: DataSet.cpp:415
void setByteArray(std::size_t i, te::dt::ByteArray *value)
Definition: DataSet.cpp:495
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
A class for representing binary data.
Definition: ByteArray.h:51
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
void setChar(std::size_t i, char value)
Definition: DataSet.cpp:345
void setString(std::size_t i, const std::string &value)
Definition: DataSet.cpp:480
void setPropertyDataType(int dt, std::size_t pos)
Definition: DataSet.cpp:244
char getChar(std::size_t i) const
Method for retrieving a signed character attribute value (1 byte long).
Definition: DataSet.cpp:340
void setPropertyName(const std::string &name, std::size_t pos)
Definition: DataSet.cpp:254
bool move(std::size_t i)
It moves the dataset internal pointer to a given position.
Definition: DataSet.cpp:314
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:111
std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const
Method for retrieving a raster attribute value.
Definition: DataSet.cpp:520
bool isAtBegin() const
It tells if the dataset internal pointer is on the first element of the collection or not...
Definition: DataSet.cpp:320
unsigned char getUChar(std::size_t i) const
Method for retrieving an unsigned character attribute value (1 byte long).
Definition: DataSet.cpp:355
void setDouble(std::size_t i, double value)
Definition: DataSet.cpp:450
void remove()
It removes the current dataset item.
Definition: DataSet.cpp:154
void setFloat(std::size_t i, float value)
Definition: DataSet.cpp:435
std::string getPropertyName(std::size_t pos) const
It returns the property name at position pos.
Definition: DataSet.cpp:249
std::auto_ptr< te::dt::Array > getArray(std::size_t i) const
Method for retrieving an array.
Definition: DataSet.cpp:550