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