27 #include "../common/Translator.h"
28 #include "../dataaccess/dataset/DataSetType.h"
29 #include "../dataaccess/utils/Utils.h"
30 #include "../datatype/AbstractData.h"
31 #include "../datatype/ByteArray.h"
32 #include "../datatype/DateTime.h"
33 #include "../datatype/Property.h"
34 #include "../datatype/SimpleData.h"
35 #include "../geometry/Geometry.h"
36 #include "../raster/Grid.h"
37 #include "../raster/RasterProperty.h"
55 m_data.resize(nproperties, 0);
59 : m_parent(rhs.m_parent)
91 return std::auto_ptr<te::mem::DataSetItem>(
new DataSetItem(*
this));
101 return m_parent->getNumProperties();
106 return m_parent->getPropertyDataType(pos);
111 return m_parent->getPropertyName(pos);
116 return static_cast<const te::dt::Char*
>(&m_data[i])->getValue();
132 return static_cast<const te::dt::UChar*
>(&m_data[i])->getValue();
143 setUChar(pos, value);
148 return static_cast<const te::dt::Int16*
>(&m_data[i])->getValue();
159 setInt16(pos, value);
164 return static_cast<const te::dt::Int32*
>(&m_data[i])->getValue();
175 setInt32(pos, value);
180 return static_cast<const te::dt::Int64*
>(&m_data[i])->getValue();
191 setInt64(pos, value);
212 return static_cast<const te::dt::Float*
>(&m_data[i])->getValue();
223 setFloat(pos, value);
228 return static_cast<const te::dt::Double*
>(&m_data[i])->getValue();
239 setDouble(pos, value);
255 setNumeric(pos, value);
260 return static_cast<const te::dt::String*
>(&m_data[i])->getValue();
271 setString(pos, value);
277 return std::auto_ptr<te::dt::ByteArray>(b);
282 m_data.replace(i, value);
288 setByteArray(pos, value);
293 return std::auto_ptr<te::gm::Geometry>(
static_cast<te::gm::Geometry*
>(m_data[i].clone()));
298 m_data.replace(i, value);
304 setGeometry(pos, value);
309 return std::auto_ptr<te::rst::Raster>(
static_cast<te::rst::Raster*
>(m_data[i].clone()));
314 m_data.replace(i, value);
320 setRaster(pos, value);
325 return std::auto_ptr<te::dt::DateTime>(
static_cast<te::dt::DateTime*
>(m_data[i].clone()));
330 m_data.replace(i, value);
336 setDateTime(pos, value);
341 switch(getPropertyDataType(i))
344 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Char(getChar(i)));
347 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UChar(getUChar(i)));
350 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int16(getInt16(i)));
353 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt16(getInt16(i)));
356 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int32(getInt32(i)));
359 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt32(getInt32(i)));
362 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int64(getInt64(i)));
365 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt64(getInt64(i)));
368 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Boolean(getBool(i)));
371 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Float(getFloat(i)));
377 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Numeric(getNumeric(i)));
380 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::String(getString(i)));
383 return std::auto_ptr<te::dt::AbstractData>(getByteArray(i).release());
386 return std::auto_ptr<te::dt::AbstractData>(getGeometry(i).release());
389 return std::auto_ptr<te::dt::AbstractData>(getDateTime(i).release());
392 return std::auto_ptr<te::dt::AbstractData>(getRaster(i).release());
395 return std::auto_ptr<te::dt::AbstractData>(0);
401 m_data.replace(i, value);
407 setValue(pos, value);
412 return boost::is_null(m_data.begin() + i);
void setFloat(std::size_t i, float value)
It sets the value of the i-th property.
std::string getNumeric(std::size_t i) const
It returns the value of the i-th property.
std::auto_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
It returns the value of the i-th property.
SimpleData< std::string, STRING_TYPE > String
void setGeometry(std::size_t i, te::gm::Geometry *value)
It sets the value of the i-th property.
void setUChar(std::size_t i, unsigned char value)
It sets the value of the i-th property.
void setDouble(std::size_t i, double value)
It sets the value of the i-th property.
std::string getPropertyName(std::size_t pos) const
It returns the name of the pos-th property.
DataSetItem & operator=(const DataSetItem &rhs)
Assignment operator.
SimpleData< unsigned char, UCHAR_TYPE > UChar
const te::da::DataSet * m_parent
The parent dataset, if the item is associated to one.
int getPropertyDataType(std::size_t pos) const
It returns the type of the pos-th property.
float getFloat(std::size_t i) const
It returns the value of the i-th property.
bool isNull(std::size_t i) const
std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
It returns the value of the i-th property.
SimpleData< boost::int64_t, INT64_TYPE > Int64
SimpleData< boost::int32_t, INT32_TYPE > Int32
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
char getChar(std::size_t i) const
It returns the value of the i-th property.
void setValue(std::size_t i, te::dt::AbstractData *value)
It sets the value of the i-th property.
bool getBool(std::size_t i) const
It returns the value of the i-th property.
boost::int64_t getInt64(std::size_t i) const
It returns the value of the i-th property.
SimpleData< float, FLOAT_TYPE > Float
boost::int16_t getInt16(std::size_t i) const
It returns the value of the i-th property.
void setInt16(std::size_t i, boost::int16_t value)
It sets the value of the i-th property.
void setChar(std::size_t i, char value)
It sets the value of the i-th property.
An exception class for the TerraLib In-Memory Data Access driver.
std::size_t getNumProperties() const
It returns the number of properties.
void setNumeric(std::size_t i, const std::string &value)
It sets the value of the i-th property.
void setBool(const std::string &name, bool value)
It sets the value of the property, indicating its name.
std::auto_ptr< DataSetItem > clone() const
It returns a clone of the DataSetItem.
SimpleData< std::string, NUMERIC_TYPE > Numeric
boost::int32_t getInt32(std::size_t i) const
It returns the value of the i-th property.
void setInt32(std::size_t i, boost::int32_t value)
It sets the value of the i-th property.
std::string getString(std::size_t i) const
It returns the value of the i-th property.
std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
It returns the value of the i-th property.
void setRaster(std::size_t i, te::rst::Raster *value)
It sets the value of the i-th property.
void setDateTime(std::size_t i, te::dt::DateTime *value)
It sets the value of the i-th property.
An abstract class for raster data strucutures.
boost::ptr_vector< boost::nullable< te::dt::AbstractData > > m_data
The data values of the dataset item.
A raster class for memory.
double getDouble(std::size_t i) const
It returns the value of the i-th property.
SimpleData< boost::uint64_t, UINT64_TYPE > UInt64
A base class for values that can be retrieved from the data access module.
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
unsigned char getUChar(std::size_t i) const
It returns the value of the i-th property.
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...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
te::da::DataSet * getParent() const
It returns its parent.
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
void setByteArray(std::size_t i, te::dt::ByteArray *value)
It sets the value of the i-th property.
A dataset is the unit of information manipulated by the data access module of TerraLib.
SimpleData< bool, BOOLEAN_TYPE > Boolean
DataSetItem(const te::da::DataSet *parent)
It creates a new item having the same schema as the parent dataset.
SimpleData< double, DOUBLE_TYPE > Double
SimpleData< char, CHAR_TYPE > Char
void setBool(std::size_t i, bool value)
It sets the value of the i-th property.
~DataSetItem()
Destructor.
SimpleData< boost::uint16_t, UINT16_TYPE > UInt16
std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
It returns the value of the i-th property.
A template for atomic data types (integers, floats, strings and others).
void setString(std::size_t i, const std::string &value)
It sets the value of the i-th property.
void setInt64(std::size_t i, boost::int64_t value)
It sets the value of the i-th property.
SimpleData< boost::int16_t, INT16_TYPE > Int16
std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const
It returns the value of the i-th property.
SimpleData< boost::uint32_t, UINT32_TYPE > UInt32
A class for representing binary data.