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"
54 m_data.resize(nproperties, 0);
60 m_data.resize(nproperties, 0);
64 : m_parent(rhs.m_parent)
96 return std::auto_ptr<te::mem::DataSetItem>(
new DataSetItem(*
this));
106 return m_parent->getNumProperties();
111 return m_parent->getPropertyDataType(pos);
116 return m_parent->getPropertyName(pos);
121 return static_cast<const te::dt::Char*
>(&m_data[i])->getValue();
137 return static_cast<const te::dt::UChar*
>(&m_data[i])->getValue();
148 setUChar(pos, value);
153 return static_cast<const te::dt::Int16*
>(&m_data[i])->getValue();
164 setInt16(pos, value);
169 return static_cast<const te::dt::Int32*
>(&m_data[i])->getValue();
180 setInt32(pos, value);
185 return static_cast<const te::dt::Int64*
>(&m_data[i])->getValue();
196 setInt64(pos, value);
217 return static_cast<const te::dt::Float*
>(&m_data[i])->getValue();
228 setFloat(pos, value);
233 return static_cast<const te::dt::Double*
>(&m_data[i])->getValue();
260 setNumeric(pos, value);
265 return static_cast<const te::dt::String*
>(&m_data[i])->getValue();
276 setString(pos, value);
282 return std::auto_ptr<te::dt::ByteArray>(b);
287 m_data.replace(i, value);
298 return std::auto_ptr<te::gm::Geometry>(
static_cast<te::gm::Geometry*
>(m_data[i].clone()));
303 m_data.replace(i, value);
309 setGeometry(pos, value);
314 return std::auto_ptr<te::rst::Raster>(
static_cast<te::rst::Raster*
>(m_data[i].clone()));
319 m_data.replace(i, value);
325 setRaster(pos, value);
330 return std::auto_ptr<te::dt::DateTime>(
static_cast<te::dt::DateTime*
>(m_data[i].clone()));
335 m_data.replace(i, value);
341 setDateTime(pos, value);
346 switch(getPropertyDataType(i))
349 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Char(getChar(i)));
352 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UChar(getUChar(i)));
355 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int16(getInt16(i)));
358 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt16(getInt16(i)));
361 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int32(getInt32(i)));
364 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt32(getInt32(i)));
367 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int64(getInt64(i)));
370 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt64(getInt64(i)));
373 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Boolean(getBool(i)));
376 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Float(getFloat(i)));
382 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Numeric(getNumeric(i)));
385 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::String(getString(i)));
388 return std::auto_ptr<te::dt::AbstractData>(getByteArray(i).release());
391 return std::auto_ptr<te::dt::AbstractData>(getGeometry(i).release());
394 return std::auto_ptr<te::dt::AbstractData>(getDateTime(i).release());
397 return std::auto_ptr<te::dt::AbstractData>(getRaster(i).release());
400 return std::auto_ptr<te::dt::AbstractData>(0);
406 m_data.replace(i, value);
412 setValue(pos, value);
417 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
void setByteArray(const std::string &name, te::dt::ByteArray *value)
It sets the value of the property, indicating its name.
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.
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.
void setDouble(const std::string &name, double value)
It sets the value of the property, indicating its name.
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.
virtual ~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.