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