An adapter for DataSet. More...
#include <DataSetAdapter.h>
Public Member Functions | |
Constructor/Destructor | |
Initilizer methods. | |
DataSetAdapter (DataSet *dataset, bool isOwner=false) | |
Constructor. More... | |
~DataSetAdapter () | |
Destructor. More... | |
te::common::TraverseType | getTraverseType () const |
It returns the traverse type associated to the dataset. More... | |
te::common::AccessPolicy | getAccessPolicy () const |
It returns the read and write permission associated to the dataset. More... | |
std::unique_ptr< te::gm::Envelope > | getExtent (std::size_t i) |
It computes the bounding rectangle for a spatial property of the dataset. More... | |
std::size_t | getNumProperties () const |
It returns the number of properties that composes an item of the dataset. More... | |
int | getPropertyDataType (std::size_t pos) const |
It returns the underlying data type of the property at position pos. More... | |
std::string | getPropertyName (std::size_t pos) const |
It returns the property name at position pos. More... | |
std::string | getDatasetNameOfProperty (std::size_t pos) const |
It returns the underlying dataset name of the property at position pos. More... | |
bool | isEmpty () const |
It returns true if the collection is empty. More... | |
bool | isConnected () const |
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source. More... | |
std::size_t | size () const |
It returns the collection size, if it is known. More... | |
bool | moveNext () |
It moves the internal pointer to the next item of the collection. More... | |
bool | movePrevious () |
It moves the internal pointer to the previous item of the collection. More... | |
bool | moveBeforeFirst () |
It moves the internal pointer to a position before the first item in the collection. More... | |
bool | moveFirst () |
It moves the internal pointer to the first item in the collection. More... | |
bool | moveLast () |
It sets the dataset internal pointer to the last item in the collection. More... | |
bool | move (std::size_t i) |
It moves the dataset internal pointer to a given position. More... | |
bool | isAtBegin () const |
It tells if the dataset internal pointer is on the first element of the collection or not. More... | |
bool | isBeforeBegin () const |
It tells if the dataset internal pointer is in a position before the first element of the collection or not. More... | |
bool | isAtEnd () const |
It tells if the dataset internal pointer is on the last element of the collection. More... | |
bool | isAfterEnd () const |
It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not. More... | |
bool | isPositionValid () const |
It tells if the dataset internal pointer is on a valid position. More... | |
char | getChar (std::size_t i) const |
Method for retrieving a signed character attribute value (1 byte long). More... | |
unsigned char | getUChar (std::size_t i) const |
Method for retrieving an unsigned character attribute value (1 byte long). More... | |
boost::int16_t | getInt16 (std::size_t i) const |
Method for retrieving a 16-bit integer attribute value (2 bytes long). More... | |
boost::int32_t | getInt32 (std::size_t i) const |
Method for retrieving a 32-bit integer attribute value (4 bytes long). More... | |
boost::int64_t | getInt64 (std::size_t i) const |
Method for retrieving a 64-bit integer attribute value (8 bytes long). More... | |
bool | getBool (std::size_t i) const |
Method for retrieving a boolean attribute value. More... | |
float | getFloat (std::size_t i) const |
Method for retrieving a float attribute value. More... | |
double | getDouble (std::size_t i) const |
Method for retrieving a double attribute value. More... | |
std::string | getNumeric (std::size_t i) const |
Method for retrieving a numeric attribute value. More... | |
std::string | getString (std::size_t i) const |
Method for retrieving a string value attribute. More... | |
std::unique_ptr< te::dt::ByteArray > | getByteArray (std::size_t i) const |
Method for retrieving a byte array. More... | |
std::unique_ptr< te::gm::Geometry > | getGeometry (std::size_t i) const |
Method for retrieving a geometric attribute value. More... | |
std::unique_ptr< te::rst::Raster > | getRaster (std::size_t i) const |
Method for retrieving a raster attribute value. More... | |
std::unique_ptr< te::dt::DateTime > | getDateTime (std::size_t i) const |
Method for retrieving a date and time attribute value. More... | |
std::unique_ptr< te::dt::Array > | getArray (std::size_t i) const |
Method for retrieving an array. More... | |
bool | isNull (std::size_t i) const |
It checks if the attribute value is NULL. More... | |
DataSet Adapter Extended Methods | |
Methods that exists only in the DataSet Adapter implementation. | |
te::da::DataSet * | getAdaptee () const |
This method returns the pointer to the DataSet that is handled by adapter. More... | |
void | add (const std::string &newPropertyName, int newPropertyType, const std::vector< std::size_t > &adaptedPropertyPos, AttributeConverter conv) |
DataSet Element Properties | |
Methods for retrieving/setting the dataset item component values without the need to explicitly instantiate an item via getItem method. | |
virtual char | getChar (const std::string &name) const |
Method for retrieving a signed character attribute value (1 byte long). More... | |
virtual unsigned char | getUChar (const std::string &name) const |
Method for retrieving an unsigned character attribute value (1 byte long). More... | |
virtual boost::int16_t | getInt16 (const std::string &name) const |
Method for retrieving a 16-bit integer attribute value (2 bytes long). More... | |
virtual boost::int32_t | getInt32 (const std::string &name) const |
Method for retrieving a 32-bit integer attribute value (4 bytes long). More... | |
virtual boost::int64_t | getInt64 (const std::string &name) const |
Method for retrieving a 64-bit integer attribute value (8 bytes long). More... | |
virtual bool | getBool (const std::string &name) const |
Method for retrieving a boolean attribute value. More... | |
virtual float | getFloat (const std::string &name) const |
Method for retrieving a float attribute value. More... | |
virtual double | getDouble (const std::string &name) const |
Method for retrieving a double attribute value. More... | |
virtual std::string | getNumeric (const std::string &name) const |
Method for retrieving a numeric attribute value. More... | |
virtual std::string | getString (const std::string &name) const |
Method for retrieving a string attribute value. More... | |
virtual std::unique_ptr< te::dt::ByteArray > | getByteArray (const std::string &name) const |
Method for retrieving a byte array. More... | |
virtual std::unique_ptr< te::gm::Geometry > | getGeometry (const std::string &name) const |
Method for retrieving a geometric attribute value. More... | |
virtual std::unique_ptr< te::da::DataSetItem > | getItem () const |
Method for retrieving a dataset item containing all the values in the current row. More... | |
virtual std::unique_ptr< te::rst::Raster > | getRaster (const std::string &name) const |
Method for retrieving a raster attribute value. More... | |
virtual std::unique_ptr< te::dt::DateTime > | getDateTime (const std::string &name) const |
Method for retrieving a date and time attribute value. More... | |
virtual std::unique_ptr< te::dt::Array > | getArray (const std::string &name) const |
Method for retrieving an array. More... | |
virtual 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. More... | |
virtual std::unique_ptr< te::dt::AbstractData > | getValue (const std::string &name) const |
Method for retrieving any other type of data value stored in the data source. More... | |
virtual std::string | getAsString (std::size_t i, int precision=0) const |
Method for retrieving a data value as a string plain representation. More... | |
virtual std::string | getAsString (const std::string &name, int precision=0) const |
Method for retrieving a data value as a string plain representation. More... | |
virtual bool | isNull (const std::string &name) const |
It checks if the attribute value is NULL. More... | |
DataSet Adapter Internal Methods | |
DataSet Adapter Internal Methods implementation. | |
std::vector< int > | m_datatypes |
The datatype for each property. More... | |
std::vector< std::string > | m_pnames |
The name for each property. More... | |
te::common::Holder< DataSet > | m_ds |
A pointer to the DataSet that will be handled by adapter. More... | |
std::vector< std::vector< std::size_t > > | m_propertyIndexes |
A vector that stores the adapted property indexes. More... | |
std::vector< AttributeConverter > | m_converters |
A vector that stores the attribute converters functions. More... | |
te::dt::AbstractData * | getAdaptedValue (std::size_t i) const |
te::da::DataSetAdapter::DataSetAdapter | ( | DataSet * | dataset, |
bool | isOwner = false |
||
) |
Constructor.
dataset | A pointer to the DataSet that will be handled by adapter. |
isOwner | If true the DataSetAdapter will have the ownership of the given data set pointer. |
te::da::DataSetAdapter::~DataSetAdapter | ( | ) |
Destructor.
void te::da::DataSetAdapter::add | ( | const std::string & | newPropertyName, |
int | newPropertyType, | ||
const std::vector< std::size_t > & | adaptedPropertyPos, | ||
AttributeConverter | conv | ||
) |
|
virtual |
It returns the read and write permission associated to the dataset.
Implements te::da::DataSet.
|
private |
te::da::DataSet * te::da::DataSetAdapter::getAdaptee | ( | ) | const |
|
virtualinherited |
Method for retrieving an array.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
|
virtualinherited |
Method for retrieving a data value as a string plain representation.
name | The attribute name. |
precision | The precision in the conversion. |
Exception | if property not found. |
|
virtualinherited |
Method for retrieving a data value as a string plain representation.
i | The attribute index. |
precision | The precision in the conversion. |
|
virtualinherited |
Method for retrieving a boolean attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a boolean attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a byte array.
You can use this method in order to retrieve a BLOB data.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a byte array.
You can use this method in order to retrieve a BLOB data.
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a signed character attribute value (1 byte long).
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a signed character attribute value (1 byte long).
i | The attribute index. |
Implements te::da::DataSet.
|
virtual |
It returns the underlying dataset name of the property at position pos.
i | The property position of interest. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a date and time attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a date and time attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a double attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a double attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtual |
It computes the bounding rectangle for a spatial property of the dataset.
i | The position of a spatial property to get its bounding box. |
Exception | It throws an exception if something goes wrong during MBR search. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a float attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a float attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a geometric attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a geometric attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a 16-bit integer attribute value (2 bytes long).
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a 16-bit integer attribute value (2 bytes long).
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a 32-bit integer attribute value (4 bytes long).
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a 32-bit integer attribute value (4 bytes long).
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a 64-bit integer attribute value (8 bytes long).
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a 64-bit integer attribute value (8 bytes long).
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a dataset item containing all the values in the current row.
|
virtualinherited |
Method for retrieving a numeric attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a numeric attribute value.
i | The attribute index. |
Implements te::da::DataSet.
|
virtual |
It returns the number of properties that composes an item of the dataset.
Implements te::da::DataSet.
|
virtual |
It returns the underlying data type of the property at position pos.
i | The property position of interest. |
Implements te::da::DataSet.
|
virtual |
It returns the property name at position pos.
i | The property name at the position of interest. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a raster attribute value.
name | The attribute name. |
Exception | It can throw an exception if:
|
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a raster attribute value.
i | The attribute index. |
Exception | It can throw an exception if:
|
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving a string attribute value.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving a string value attribute.
i | The attribute index. |
Implements te::da::DataSet.
|
virtual |
It returns the traverse type associated to the dataset.
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving an unsigned character attribute value (1 byte long).
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
Method for retrieving an unsigned character attribute value (1 byte long).
i | The attribute index. |
Implements te::da::DataSet.
|
virtualinherited |
Method for retrieving any other type of data value stored in the data source.
This method can be use for extensible datatypes.
name | The attribute name. |
|
virtualinherited |
Method for retrieving any other type of data value stored in the data source.
This method can be use for extensible datatypes.
i | The attribute index. |
Reimplemented in te::mem::DataSet, and te::stmem::DataSet.
|
virtual |
It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not.
Implements te::da::DataSet.
|
virtual |
It tells if the dataset internal pointer is on the first element of the collection or not.
Implements te::da::DataSet.
|
virtual |
It tells if the dataset internal pointer is on the last element of the collection.
Implements te::da::DataSet.
|
virtual |
It tells if the dataset internal pointer is in a position before the first element of the collection or not.
Implements te::da::DataSet.
|
virtual |
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source.
Implements te::da::DataSet.
|
virtual |
It returns true if the collection is empty.
Implements te::da::DataSet.
|
virtualinherited |
It checks if the attribute value is NULL.
name | The attribute name. |
Reimplemented in te::gdal::DataSet.
|
virtual |
It checks if the attribute value is NULL.
i | The attribute index. |
Implements te::da::DataSet.
|
virtual |
It tells if the dataset internal pointer is on a valid position.
Implements te::da::DataSet.
|
virtual |
It moves the dataset internal pointer to a given position.
i | The position the dataset internal pointer must be set up. |
Implements te::da::DataSet.
|
virtual |
It moves the internal pointer to a position before the first item in the collection.
Implements te::da::DataSet.
|
virtual |
It moves the internal pointer to the first item in the collection.
Implements te::da::DataSet.
|
virtual |
It sets the dataset internal pointer to the last item in the collection.
Implements te::da::DataSet.
|
virtual |
It moves the internal pointer to the next item of the collection.
You always has to call this method in order to move the internal pointer to the first item in the collection. This method can be used to traverse a dataset.
Implements te::da::DataSet.
|
virtual |
It moves the internal pointer to the previous item of the collection.
Implements te::da::DataSet.
|
virtual |
It returns the collection size, if it is known.
It may return std::string::npos if the size is not known, or it would be too costly to compute it.
Implements te::da::DataSet.
|
private |
A vector that stores the attribute converters functions.
Definition at line 188 of file DataSetAdapter.h.
|
private |
The datatype for each property.
Definition at line 184 of file DataSetAdapter.h.
|
private |
A pointer to the DataSet that will be handled by adapter.
Definition at line 186 of file DataSetAdapter.h.
|
private |
The name for each property.
Definition at line 185 of file DataSetAdapter.h.
|
private |
A vector that stores the adapted property indexes.
Definition at line 187 of file DataSetAdapter.h.