Class used to centralize and control access to data in terralib. It aims to create a high-level interface for simplifying the concepts defined in the terralib DataAccess module. More...
#include <DataAccess.h>
Public Member Functions | |
void | createDataSet (te::da::DataSetType *dataSetType) |
Function used to create a new DataSet into internal datasource. This class will NOT take the ownership of the dataSetType pointer. More... | |
DataAccess (const te::core::URI &uri, const std::string &dataSourceDriver, const std::string &dataSetName="") | |
constructor. More... | |
DataAccess (te::da::DataSourcePtr dataSource, const std::string &dataSetName="") | |
Constructor. More... | |
DataAccess (te::da::DataSourcePtr dataSource, const te::da::DataSetType *dataSetType) | |
constructor. More... | |
bool | dataSetExists () const |
te::da::DataSetTypeConverter * | getConverter () const |
Get data set type. More... | |
std::unique_ptr< te::da::DataSet > | getDataSet () const |
Get dataset using internal information (data source, query, datasetTypeConverter) More... | |
std::string | getDataSetName () const |
Get data set name. More... | |
const te::da::DataSetType * | getDataSetType () const |
Get data set type. More... | |
te::da::DataSourcePtr | getDataSource () const |
Get the data source associated with this data access. More... | |
std::string | getDataSourceConnectionInfo () |
Get data source connection info. More... | |
std::vector< std::string > | getDistinctValues (const std::string &attributeName) |
Function used to get distinct values ir order, from a specific attribute. More... | |
te::da::Literal * | getLiteral (const std::string &attributeName, const std::string &value) |
It creates a Literal Expression based on a attribute type. More... | |
te::gm::Envelope | getMBR () const |
Gets the MBR of the data access. More... | |
te::da::Select * | getQuery () const |
Get query object. More... | |
int | getSRID () const |
Gets the SRID of the data access. More... | |
std::string | getStrQuery () const |
Get query object as string. More... | |
std::unique_ptr< te::da::DataSet > | query (const te::da::Select &select) |
Get dataset using internal information (data source, datasetTypeConverter), but using query parameter for data restriction. More... | |
std::unique_ptr< te::da::DataSet > | query (const std::string &query) |
void | saveDataSet (te::da::DataSet *dataSet, bool enableProgress=true) |
Function used to save data into internal datasource (if a converter was defined, it will be used) More... | |
void | setConverter (te::da::DataSetTypeConverter *converter) |
Set data set converter type. More... | |
void | setObjectIdSetFilter (const te::da::ObjectIdSet *objectIdSetFilter) |
void | setQuery (te::da::Select *select) |
Set data set restriction. More... | |
~DataAccess () | |
Default destructor. More... | |
Protected Attributes | |
std::string | m_dataSetName |
Dataset name. More... | |
std::unique_ptr< te::da::Select > | m_dataSetQuery |
Filter used to load data with restriction. More... | |
std::unique_ptr< te::da::DataSetType > | m_dataSetType |
Data set type. More... | |
std::unique_ptr< te::da::DataSetTypeConverter > | m_dataSetTypeConverter |
DataSetType Converter. More... | |
te::da::DataSourcePtr | m_dataSource |
Data source. More... | |
std::unique_ptr< te::da::ObjectIdSet > | m_objectIdSetFilter |
A optional filter containg an objectId set. More... | |
Class used to centralize and control access to data in terralib. It aims to create a high-level interface for simplifying the concepts defined in the terralib DataAccess module.
Definition at line 73 of file DataAccess.h.
te::da::DataAccess::DataAccess | ( | const te::core::URI & | uri, |
const std::string & | dataSourceDriver, | ||
const std::string & | dataSetName = "" |
||
) |
constructor.
uri | The URI used to describe the datasource connection. |
dataSourceDriver | The data source type name (example: POSTGIS, ORACLE, SQLITE). |
dataSetName | The dataset name (not needed to inform if DataAccess will be used to create a new Dataset) |
Exception | An exception can be thrown, if the data source cannot be created or opened and dataset not found. |
te::da::DataAccess::DataAccess | ( | te::da::DataSourcePtr | dataSource, |
const std::string & | dataSetName = "" |
||
) |
Constructor.
dataSource | The data source pointer. |
dataSetName | The dataset name (not needed to inform if DataAccess will be used to create a new Dataset) |
Exception | An exception can be thrown, if the data source cannot be opened or dataset not found. |
te::da::DataAccess::DataAccess | ( | te::da::DataSourcePtr | dataSource, |
const te::da::DataSetType * | dataSetType | ||
) |
te::da::DataAccess::~DataAccess | ( | ) |
Default destructor.
Check if the the dataSet exists
void te::da::DataAccess::createDataSet | ( | te::da::DataSetType * | dataSetType | ) |
bool te::da::DataAccess::dataSetExists | ( | ) | const |
te::da::DataSetTypeConverter* te::da::DataAccess::getConverter | ( | ) | const |
Get data set type.
std::unique_ptr<te::da::DataSet> te::da::DataAccess::getDataSet | ( | ) | const |
Get dataset using internal information (data source, query, datasetTypeConverter)
std::string te::da::DataAccess::getDataSetName | ( | ) | const |
Get data set name.
const te::da::DataSetType* te::da::DataAccess::getDataSetType | ( | ) | const |
Get data set type.
te::da::DataSourcePtr te::da::DataAccess::getDataSource | ( | ) | const |
Get the data source associated with this data access.
std::string te::da::DataAccess::getDataSourceConnectionInfo | ( | ) |
Get data source connection info.
std::vector<std::string> te::da::DataAccess::getDistinctValues | ( | const std::string & | attributeName | ) |
Function used to get distinct values ir order, from a specific attribute.
attributeName | String with attribute name |
te::da::Literal* te::da::DataAccess::getLiteral | ( | const std::string & | attributeName, |
const std::string & | value | ||
) |
It creates a Literal Expression based on a attribute type.
attributeName | Attribute name from data set |
value | Attribute value used to create the right Literal expression |
te::gm::Envelope te::da::DataAccess::getMBR | ( | ) | const |
Gets the MBR of the data access.
te::da::Select* te::da::DataAccess::getQuery | ( | ) | const |
Get query object.
int te::da::DataAccess::getSRID | ( | ) | const |
Gets the SRID of the data access.
std::string te::da::DataAccess::getStrQuery | ( | ) | const |
Get query object as string.
std::unique_ptr<te::da::DataSet> te::da::DataAccess::query | ( | const te::da::Select & | select | ) |
std::unique_ptr<te::da::DataSet> te::da::DataAccess::query | ( | const std::string & | query | ) |
void te::da::DataAccess::saveDataSet | ( | te::da::DataSet * | dataSet, |
bool | enableProgress = true |
||
) |
Function used to save data into internal datasource (if a converter was defined, it will be used)
dataSet | Pointer to a data set to be saved |
void te::da::DataAccess::setConverter | ( | te::da::DataSetTypeConverter * | converter | ) |
Set data set converter type.
converter | The data set type converter pointer |
void te::da::DataAccess::setObjectIdSetFilter | ( | const te::da::ObjectIdSet * | objectIdSetFilter | ) |
void te::da::DataAccess::setQuery | ( | te::da::Select * | select | ) |
Set data set restriction.
select | The data set query pointer |
|
protected |
Dataset name.
Definition at line 270 of file DataAccess.h.
|
protected |
Filter used to load data with restriction.
Definition at line 269 of file DataAccess.h.
|
protected |
Data set type.
Definition at line 267 of file DataAccess.h.
|
protected |
DataSetType Converter.
Definition at line 268 of file DataAccess.h.
|
protected |
Data source.
Definition at line 266 of file DataAccess.h.
|
protected |
A optional filter containg an objectId set.
Definition at line 271 of file DataAccess.h.