Go to the documentation of this file.
26 #ifndef __TERRALIB_MEMORY_INTERNAL_DATASET_H
27 #define __TERRALIB_MEMORY_INTERNAL_DATASET_H
30 #include "../dataaccess/dataset/DataSet.h"
38 #include <boost/ptr_container/ptr_vector.hpp>
39 #include <boost/shared_ptr.hpp>
254 std::unique_ptr<te::gm::Envelope>
getExtent(std::size_t i);
300 std::unique_ptr<te::gm::Geometry>
getGeometry(std::size_t i)
const;
302 std::unique_ptr<te::rst::Raster>
getRaster(std::size_t i)
const;
304 std::unique_ptr<te::dt::DateTime>
getDateTime(std::size_t i)
const;
306 std::unique_ptr<te::dt::Array>
getArray(std::size_t i)
const;
308 std::unique_ptr<te::dt::AbstractData>
getValue(std::size_t i)
const;
320 void setChar(
const std::string& name,
char value);
324 void setUChar(
const std::string& name,
unsigned char value);
326 void setInt16(std::size_t i, boost::int16_t value);
328 void setInt16(
const std::string& name, boost::int16_t value);
330 void setInt32(std::size_t i, boost::int32_t value);
332 void setInt32(
const std::string& name, boost::int32_t value);
334 void setInt64(std::size_t i, boost::int64_t value);
336 void setInt64(
const std::string& name, boost::int64_t value);
340 void setBool(
const std::string& name,
bool value);
344 void setFloat(
const std::string& name,
float value);
352 void setNumeric(
const std::string& name,
const std::string& value);
354 void setString(std::size_t i,
const std::string& value);
356 void setString(
const std::string& name,
const std::string& value);
382 boost::shared_ptr<boost::ptr_vector<te::mem::DataSetItem> >
m_items;
393 #endif // __TERRALIB_MEMORY_INTERNAL_DATASET_H
te::common::TraverseType getTraverseType() const
It returns the traverse type associated to the dataset.
bool moveNext()
It moves the internal pointer to the next item of the collection.
std::size_t getNumProperties() const
It returns the number of properties that composes an item of the dataset.
A class for representing binary data.
void setString(const std::string &name, const std::string &value)
void setDouble(const std::string &name, double value)
void setInt32(std::size_t i, boost::int32_t value)
boost::int16_t getInt16(std::size_t i) const
Method for retrieving a 16-bit integer attribute value (2 bytes long).
void setInt16(const std::string &name, boost::int16_t value)
void setValue(std::size_t i, te::dt::AbstractData *value)
boost::int64_t getInt64(std::size_t i) const
Method for retrieving a 64-bit integer attribute value (8 bytes long).
te::common::AccessPolicy getAccessPolicy() const
It returns the read and write permission associated to the dataset.
std::size_t size() const
It returns the collection size, if it is known.
An abstract class for raster data strucutures.
std::unique_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
Method for retrieving a date and time attribute value.
std::string getString(std::size_t i) const
Method for retrieving a string value attribute.
void remove(te::mem::DataSetItem *item)
It removes a specific dataset item.
int m_i
The index of the current item.
void setDateTime(const std::string &name, te::dt::DateTime *value)
void clear()
It clears all the dataset items.
bool moveLast()
It sets the dataset internal pointer to the last item in the collection.
void add(te::mem::DataSetItem *item)
It adds a new item to the dataset and takes its ownership.
TraverseType
A dataset can be traversed in two ways:
void setFloat(std::size_t i, float value)
void setNumeric(std::size_t i, const std::string &value)
bool isConnected() const
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connect...
char getChar(std::size_t i) const
Method for retrieving a signed character attribute value (1 byte long).
bool movePrevious()
It moves the internal pointer to the previous item of the collection.
void setFloat(const std::string &name, float value)
boost::shared_ptr< boost::ptr_vector< te::mem::DataSetItem > > m_items
The list of dataset items.
void setDouble(std::size_t i, double value)
bool move(std::size_t i)
It moves the dataset internal pointer to a given position.
void setPropertyName(const std::string &name, std::size_t pos)
std::unique_ptr< te::dt::Array > getArray(std::size_t i) const
Method for retrieving an array.
std::string getNumeric(std::size_t i) const
Method for retrieving a numeric attribute value.
bool isPositionValid() const
It tells if the dataset internal pointer is on a valid position.
void setGeometry(const std::string &name, te::gm::Geometry *value)
std::vector< std::string > m_pnames
The list of property names.
void setChar(std::size_t i, char value)
void setInt16(std::size_t i, boost::int16_t value)
unsigned char getUChar(std::size_t i) const
Method for retrieving an unsigned character attribute value (1 byte long).
double getDouble(std::size_t i) const
Method for retrieving a double attribute value.
void setRaster(const std::string &name, te::rst::Raster *value)
bool isEmpty() const
It returns true if the collection is empty.
void setString(std::size_t i, const std::string &value)
void setUChar(std::size_t i, unsigned char value)
void setValue(const std::string &name, te::dt::AbstractData *ad)
void setNumeric(const std::string &name, const std::string &value)
std::unique_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
void setDateTime(std::size_t i, te::dt::DateTime *value)
int getPropertyDataType(std::size_t pos) const
It returns the underlying data type of the property at position pos.
void update(te::dt::Property *prop)
It update a property from the dataset.
void setPropertyDataType(int dt, std::size_t pos)
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver.
void add(const std::string &propertyName, std::size_t propertyType, const te::dt::AbstractData *defaultValue=0)
It adds a new property to the dataset schema and fills this new property with a default value.
bool isAfterEnd() const
It tells if the dataset internal pointer is on the sentinel position after the last element of the co...
void setUChar(const std::string &name, unsigned char value)
void remove()
It removes the current dataset item.
void copy(te::da::DataSet &src, const std::vector< std::size_t > &properties, std::size_t limit=0)
It copies up to limit items from the source dataset (src).
DataSet(const DataSet &rhs, const bool deepCopy)
It creates a new In-Memory dataset with the items from the rhs dataset.
void setBool(std::size_t i, bool value)
void drop(std::size_t pos)
It drops a property from the dataset.
void setInt64(std::size_t i, boost::int64_t value)
void setByteArray(std::size_t i, te::dt::ByteArray *value)
bool isBeforeBegin() const
It tells if the dataset internal pointer is in a position before the first element of the collection ...
A base class for values that can be retrieved from the data access module.
std::vector< int > m_ptypes
The list of property types.
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
DataSet(const te::da::DataSetType *const dt)
It constructs an empty dataset having the schema dt.
boost::int32_t getInt32(std::size_t i) const
Method for retrieving a 32-bit integer attribute value (4 bytes long).
std::unique_ptr< te::rst::Raster > getRaster(std::size_t i) const
Method for retrieving a raster attribute value.
bool moveFirst()
It moves the internal pointer to the first item in the collection.
bool getBool(std::size_t i) const
Method for retrieving a boolean attribute value.
void setInt64(const std::string &name, boost::int64_t value)
It models a property definition.
A dataset is the unit of information manipulated by the data access module of TerraLib.
boost::shared_ptr< DataSet > DataSetPtr
Proxy configuration file for TerraView (see terraview_config.h).
bool isAtBegin() const
It tells if the dataset internal pointer is on the first element of the collection or not.
bool isNull(std::size_t i) const
It checks if the attribute value is NULL.
A class that models the description of a dataset.
DataSet(te::da::DataSet &rhs, const std::vector< std::size_t > &properties, std::size_t limit)
Copy constructor with property restriction.
void copy(te::da::DataSet &src, std::size_t limit=0)
It copies up to limit items from the source dataset.
void setByteArray(const std::string &name, te::dt::ByteArray *value)
void setGeometry(std::size_t i, te::gm::Geometry *value)
std::string getDatasetNameOfProperty(std::size_t pos) const
It returns the underlying dataset name of the property at position pos.
bool isAtEnd() const
It tells if the dataset internal pointer is on the last element of the collection.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::unique_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
Method for retrieving a byte array.
void setChar(const std::string &name, char value)
std::unique_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
float getFloat(std::size_t i) const
Method for retrieving a float attribute value.
void setBool(const std::string &name, bool value)
std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
Method for retrieving a geometric attribute value.
std::string getPropertyName(std::size_t pos) const
It returns the property name at position pos.
bool moveBeforeFirst()
It moves the internal pointer to a position before the first item in the collection.
AccessPolicy
Supported data access policies (can be used as bitfield).
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver.
void setRaster(std::size_t i, te::rst::Raster *value)
void setInt32(const std::string &name, boost::int32_t value)
DataSet(te::da::DataSet &rhs)
Regular copy constructor.